diff options
| author | Jeff Carr <[email protected]> | 2025-09-24 22:17:27 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-24 22:17:27 -0500 |
| commit | 71a5b271a83ff87e771d182e3f1376d1163457ef (patch) | |
| tree | 9568c3bdc3517267e2b7b2fa58769a321348e048 /main.go | |
| parent | e0520ca96d2c854324bebb902e53ef1092849bb9 (diff) | |
redoing argv handling
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 86 |
1 files changed, 30 insertions, 56 deletions
@@ -65,11 +65,6 @@ func main() { okExit("") } - if argv.BuildForge { - buildForge() - okExit("") - } - if argv.Checkout != nil { if err := doCheckout(); err != nil { badExit(err) @@ -77,19 +72,26 @@ func main() { okExit("") } - if argv.Build != "" { - if err := doBuild(); err != nil { - badExit(err) + /* + if argv.Show.BuildForge { + buildForge() + okExit("") } - okExit("") - } - if argv.Install != "" { - if err := doInstall(); err != nil { - badExit(err) + if argv.Show.Build != "" { + if err := doBuild(); err != nil { + badExit(err) + } + okExit("") } - okExit("") - } + + if argv.Install != "" { + if err := doInstall(); err != nil { + badExit(err) + } + okExit("") + } + */ if argv.Clean != nil { if err := doClean(); err != nil { @@ -99,21 +101,6 @@ func main() { okExit("") } - if argv.Help != nil { - doHelp() - okExit("") - } - - if argv.Dirty != nil { - doDirty() - okExit("") - } - - if argv.Tag != nil { - doTag() - okExit("") - } - if argv.Normal != nil { if argv.Normal.On != nil { if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL { @@ -166,10 +153,19 @@ func main() { okExit("") } - if argv.List != nil { - found := argv.List.findRepos() + if argv.Show != nil { + if argv.Show.Dirty != nil { + doDirty() + okExit("") + } + + if argv.Show.Tag != nil { + doTag() + okExit("") + } + found := findRepos() // print out the repos - if argv.List.Full { + if argv.All { me.forge.PrintHumanTableFull(found) } else { me.forge.PrintHumanTable(found) @@ -196,7 +192,7 @@ func main() { debug() // sits here forever } // got to the end with nothing to do (?) - if dumpWorkRepos() { + if showWorkRepos() { // found some repos at least } else { // every repo is in a really clean state. no extra files anywhere @@ -206,25 +202,3 @@ func main() { } okExit("") } - -// keep this small -func doHelp() { - log.Info("") - log.Info("forge -h : to see the available options") - log.Info("forge --bash : will create a bash autocomplete file") - log.Info("forge : with no arguements, forge tries to load a GO GUI plugin") - log.Info(" : there are two GUI plugins. terminal & GTK") - log.Info("") - log.Info("forge list : shows a table of all your repos") - log.Info("forge checkout : checks out all your repos to the same branch") - log.Info(" : the default is your user branch") - log.Info("forge clean : reverts all repos to the master branch") - log.Info("forge dirty : show all repos git reports as dirty") - log.Info("") - okExit("") -} - -func doHelpPatches() { - log.Info("TODO: ?") - okExit("") -} |
