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"`
|
List *FindCmd `arg:"subcommand:list" help:"print a table of the current repos"`
|
||||||
Patch *PatchCmd `arg:"subcommand:patch" help:"make patchsets"`
|
Patch *PatchCmd `arg:"subcommand:patch" help:"make patchsets"`
|
||||||
GitPull *PullCmd `arg:"subcommand:pull" help:"run 'git pull'"`
|
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"`
|
URL string `arg:"--connect" help:"forge url"`
|
||||||
All bool `arg:"--all" help:"git commit --all"`
|
All bool `arg:"--all" help:"git commit --all"`
|
||||||
Build string `arg:"--build" help:"build a repo"`
|
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'"`
|
Test *EmptyCmd `arg:"subcommand:test" help:"list repos that need 'git pull'"`
|
||||||
Dirty *EmptyCmd `arg:"subcommand:dirty" help:"only check dirty repos"`
|
Dirty *EmptyCmd `arg:"subcommand:dirty" help:"only check dirty repos"`
|
||||||
Patches *EmptyCmd `arg:"subcommand:patches" help:"only check repos with patches"`
|
Patches *EmptyCmd `arg:"subcommand:patches" help:"only check repos with patches"`
|
||||||
|
Sync *SyncCmd `arg:"subcommand:sync" help:"sync repos with upstream"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigAddCmd struct {
|
type ConfigAddCmd struct {
|
||||||
|
|
|
@ -46,7 +46,7 @@ func (args) doBashAuto() {
|
||||||
case "list":
|
case "list":
|
||||||
fmt.Println("--full")
|
fmt.Println("--full")
|
||||||
case "pull":
|
case "pull":
|
||||||
fmt.Println("list dirty patches --force")
|
fmt.Println("list dirty patches sync --force")
|
||||||
case "--find":
|
case "--find":
|
||||||
fmt.Println("foo bar")
|
fmt.Println("foo bar")
|
||||||
case "patch":
|
case "patch":
|
||||||
|
@ -64,7 +64,7 @@ func (args) doBashAuto() {
|
||||||
default:
|
default:
|
||||||
if argv.BashAuto[0] == ARGNAME {
|
if argv.BashAuto[0] == ARGNAME {
|
||||||
// list the subcommands here
|
// 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)
|
os.Exit(0)
|
||||||
|
|
|
@ -16,10 +16,10 @@ import (
|
||||||
// trys to figure out if there is still something to update
|
// trys to figure out if there is still something to update
|
||||||
|
|
||||||
func doSync() error {
|
func doSync() error {
|
||||||
if argv.Sync.Clean != nil {
|
if argv.GitPull.Sync.Clean != nil {
|
||||||
return doSyncClean()
|
return doSyncClean()
|
||||||
}
|
}
|
||||||
if argv.Sync.User != nil {
|
if argv.GitPull.Sync.User != nil {
|
||||||
return doSyncUser()
|
return doSyncUser()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
main.go
14
main.go
|
@ -96,13 +96,6 @@ func main() {
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.Sync != nil {
|
|
||||||
if err := doSync(); err != nil {
|
|
||||||
badExit(err)
|
|
||||||
}
|
|
||||||
okExit("")
|
|
||||||
}
|
|
||||||
|
|
||||||
if argv.Build != "" {
|
if argv.Build != "" {
|
||||||
if err := doBuild(); err != nil {
|
if err := doBuild(); err != nil {
|
||||||
badExit(err)
|
badExit(err)
|
||||||
|
@ -146,6 +139,13 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.GitPull != nil {
|
if argv.GitPull != nil {
|
||||||
|
if argv.GitPull.Sync != nil {
|
||||||
|
if err := doSync(); err != nil {
|
||||||
|
badExit(err)
|
||||||
|
}
|
||||||
|
okExit("")
|
||||||
|
}
|
||||||
|
|
||||||
doGitPullNew()
|
doGitPullNew()
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue