Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import: Accept the same clone flags with get command #37

Merged
merged 1 commit into from
Sep 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ var Commands = []cli.Command{
commandImport,
}

var cloneFlags = []cli.Flag{
cli.BoolFlag{Name: "update, u", Usage: "Update local repository if cloned already"},
cli.BoolFlag{Name: "p", Usage: "Clone with SSH"},
cli.BoolFlag{Name: "shallow", Usage: "Do a shallow clone"},
}

var commandGet = cli.Command{
Name: "get",
Usage: "Clone/sync with a remote repository",
Expand All @@ -31,11 +37,7 @@ var commandGet = cli.Command{
When you use '-p' option, the repository is cloned via SSH.
`,
Action: doGet,
Flags: []cli.Flag{
cli.BoolFlag{Name: "update, u", Usage: "Update local repository if cloned already"},
cli.BoolFlag{Name: "p", Usage: "Clone with SSH"},
cli.BoolFlag{Name: "shallow", Usage: "Do a shallow clone"},
},
Flags: cloneFlags,
}

var commandList = cli.Command{
Expand Down Expand Up @@ -69,6 +71,7 @@ var commandImport = cli.Command{
Name: "import",
Usage: "Bulk get repositories from a file or stdin",
Action: doImport,
Flags: cloneFlags,
}

type commandDoc struct {
Expand Down