-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from rsteube/add-git-clone
added git clone
- Loading branch information
Showing
1 changed file
with
24 additions
and
12 deletions.
There are no files selected for viewing
36 changes: 24 additions & 12 deletions
36
...ters/git_completer/cmd/clone_generated.go → completers/git_completer/cmd/clone.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,61 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var cloneCmd = &cobra.Command{ | ||
Use: "clone", | ||
Short: "Clone a repository into a new directory", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
}, | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
cloneCmd.Flags().BoolP("ipv4", "4", false, "use IPv4 addresses only") | ||
cloneCmd.Flags().BoolP("ipv6", "6", false, "use IPv6 addresses only") | ||
carapace.Gen(cloneCmd).Standalone() | ||
|
||
cloneCmd.Flags().Bool("bare", false, "create a bare repository") | ||
cloneCmd.Flags().BoolP("branch", "b", false, "<branch> checkout <branch> instead of the remote's HEAD") | ||
cloneCmd.Flags().BoolP("config", "c", false, "<key=value> set config inside the new repository") | ||
cloneCmd.Flags().StringP("branch", "b", "", "checkout <branch> instead of the remote's HEAD") | ||
cloneCmd.Flags().StringP("config", "c", "", "set config inside the new repository") | ||
cloneCmd.Flags().String("depth", "", "create a shallow clone of that depth") | ||
cloneCmd.Flags().Bool("dissociate", false, "use --reference only while cloning") | ||
cloneCmd.Flags().String("filter", "", "object filtering") | ||
cloneCmd.Flags().BoolP("jobs", "j", false, "<n> number of submodules cloned in parallel") | ||
cloneCmd.Flags().BoolP("ipv4", "4", false, "use IPv4 addresses only") | ||
cloneCmd.Flags().BoolP("ipv6", "6", false, "use IPv6 addresses only") | ||
cloneCmd.Flags().StringP("jobs", "j", "", "number of submodules cloned in parallel") | ||
cloneCmd.Flags().BoolP("local", "l", false, "to clone from a local repository") | ||
cloneCmd.Flags().Bool("mirror", false, "create a mirror repository (implies bare)") | ||
cloneCmd.Flags().BoolP("no-checkout", "n", false, "don't create a checkout") | ||
cloneCmd.Flags().Bool("no-hardlinks", false, "don't use local hardlinks, always copy") | ||
cloneCmd.Flags().Bool("no-tags", false, "don't clone any tags, and make later fetches not to follow them") | ||
cloneCmd.Flags().BoolP("origin", "o", false, "<name> use <name> instead of 'origin' to track upstream") | ||
cloneCmd.Flags().StringP("origin", "o", "", "use <name> instead of 'origin' to track upstream") | ||
cloneCmd.Flags().Bool("progress", false, "force progress reporting") | ||
cloneCmd.Flags().BoolP("quiet", "q", false, "be more quiet") | ||
cloneCmd.Flags().String("recurse-submodules", "", "initialize submodules in the clone") | ||
cloneCmd.Flags().String("recursive", "", "initialize submodules in the clone") | ||
cloneCmd.Flags().String("reference-if-able", "", "reference repository") | ||
cloneCmd.Flags().String("recursive", "", "alias of --recurse-submodules") | ||
cloneCmd.Flags().String("reference", "", "reference repository") | ||
cloneCmd.Flags().String("reference-if-able", "", "reference repository") | ||
cloneCmd.Flags().Bool("remote-submodules", false, "any cloned submodules will use their remote-tracking branch") | ||
cloneCmd.Flags().String("separate-git-dir", "", "separate git dir from working tree") | ||
cloneCmd.Flags().String("server-option", "", "option to transmit") | ||
cloneCmd.Flags().String("shallow-exclude", "", "deepen history of shallow clone, excluding rev") | ||
cloneCmd.Flags().String("shallow-since", "", "create a shallow clone since a specific time") | ||
cloneCmd.Flags().Bool("shallow-submodules", false, "any cloned submodules will be shallow") | ||
cloneCmd.Flags().BoolP("shared", "s", false, "setup as shared repository") | ||
cloneCmd.Flags().Bool("single-branch", false, "clone only one branch, HEAD or --branch") | ||
cloneCmd.Flags().Bool("sparse", false, "initialize sparse-checkout file to include only files at root") | ||
cloneCmd.Flags().BoolP("shared", "s", false, "setup as shared repository") | ||
cloneCmd.Flags().String("template", "", "directory from which templates will be used") | ||
cloneCmd.Flags().BoolP("upload-pack", "u", false, "<path> path to git-upload-pack on the remote") | ||
cloneCmd.Flags().StringP("upload-pack", "u", "", "path to git-upload-pack on the remote") | ||
cloneCmd.Flags().BoolP("verbose", "v", false, "be more verbose") | ||
rootCmd.AddCommand(cloneCmd) | ||
|
||
carapace.Gen(cloneCmd).FlagCompletion(carapace.ActionMap{ | ||
"separate-git-dir": carapace.ActionFiles(""), | ||
"template": carapace.ActionDirectories(), | ||
}) | ||
|
||
carapace.Gen(cloneCmd).PositionalCompletion( | ||
carapace.ActionValues(), | ||
carapace.ActionDirectories(), | ||
) | ||
} |