move argv "sync" under "pull"

This commit is contained in:
Jeff Carr 2025-07-07 20:14:24 -05:00
parent d3938adf63
commit e2d33ea496
4 changed files with 12 additions and 12 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -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
View File

@ -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("")
}