diff --git a/argv.go b/argv.go index 143f53b..2502a23 100644 --- a/argv.go +++ b/argv.go @@ -25,7 +25,6 @@ type args struct { List *FindCmd `arg:"subcommand:list" help:"print a table of the current repos"` Patch *PatchCmd `arg:"subcommand:patch" help:"make patchsets"` GitPull *PullCmd `arg:"subcommand:pull" help:"run 'git pull'"` - Sync *SyncCmd `arg:"subcommand:sync" help:"sync repos with upstream"` URL string `arg:"--connect" help:"forge url"` All bool `arg:"--all" help:"git commit --all"` Build string `arg:"--build" help:"build a repo"` @@ -71,6 +70,7 @@ type PullCmd struct { Test *EmptyCmd `arg:"subcommand:test" help:"list repos that need 'git pull'"` Dirty *EmptyCmd `arg:"subcommand:dirty" help:"only check dirty repos"` Patches *EmptyCmd `arg:"subcommand:patches" help:"only check repos with patches"` + Sync *SyncCmd `arg:"subcommand:sync" help:"sync repos with upstream"` } type ConfigAddCmd struct { diff --git a/argvAutoshell.go b/argvAutoshell.go index e812a55..30e5677 100644 --- a/argvAutoshell.go +++ b/argvAutoshell.go @@ -46,7 +46,7 @@ func (args) doBashAuto() { case "list": fmt.Println("--full") case "pull": - fmt.Println("list dirty patches --force") + fmt.Println("list dirty patches sync --force") case "--find": fmt.Println("foo bar") case "patch": @@ -64,7 +64,7 @@ func (args) doBashAuto() { default: if argv.BashAuto[0] == ARGNAME { // list the subcommands here - fmt.Println("--bash list checkout clean commit config dirty debug fetch patch pull sync") + fmt.Println("--bash list checkout clean commit config dirty debug fetch patch pull") } } os.Exit(0) diff --git a/doSync.go b/doSync.go index f6a9683..57bf0c6 100644 --- a/doSync.go +++ b/doSync.go @@ -16,10 +16,10 @@ import ( // trys to figure out if there is still something to update func doSync() error { - if argv.Sync.Clean != nil { + if argv.GitPull.Sync.Clean != nil { return doSyncClean() } - if argv.Sync.User != nil { + if argv.GitPull.Sync.User != nil { return doSyncUser() } diff --git a/main.go b/main.go index e35ab46..d9dcd73 100644 --- a/main.go +++ b/main.go @@ -96,13 +96,6 @@ func main() { okExit("") } - if argv.Sync != nil { - if err := doSync(); err != nil { - badExit(err) - } - okExit("") - } - if argv.Build != "" { if err := doBuild(); err != nil { badExit(err) @@ -146,6 +139,13 @@ func main() { } if argv.GitPull != nil { + if argv.GitPull.Sync != nil { + if err := doSync(); err != nil { + badExit(err) + } + okExit("") + } + doGitPullNew() okExit("") }