move argv "sync" under "pull"
This commit is contained in:
parent
d3938adf63
commit
e2d33ea496
2
argv.go
2
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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
14
main.go
14
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("")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue