diff options
| author | Jeff Carr <[email protected]> | 2025-10-09 04:31:10 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-09 04:31:10 -0500 |
| commit | 98bb38d6999f94d507868247841d9b8d6eff8a75 (patch) | |
| tree | f1dc35b0dad362e128d975d4b8a04247756838a2 /main.go | |
| parent | 0b646a20b812f337251c0ed950afeba9b97cfcc7 (diff) | |
cleaning up publish
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 41 |
1 files changed, 18 insertions, 23 deletions
@@ -26,48 +26,41 @@ var resources embed.FS func main() { me = new(mainType) // autocomplete must be processed before there is anything sent to STDOUT or STDERR - me.sh = prep.Bash3(&argv) // add support for bash autocomplete with go-arg + me.sh = prep.Bash(&argv) // add support for bash autocomplete with go-arg me.homedir, _ = os.UserHomeDir() // store shortcut here todo: add better logic + if me.sh.Cmd == "" { + // user didn't enter a sub command + // doDefaultBehavior() + me.sh.GoodExit("do what?") + } + + // Standard subcommand handling starts here + var s string + var err error + if argv.Upgrade != nil { doUpgrade() me.sh.GoodExit("") } if argv.Linux != nil { - var s string - var err error if argv.Linux.Rdate != nil { s, err = doRdate() } - if err != nil { - me.sh.BadExit(s, err) - } - me.sh.GoodExit(s) } if argv.Build != nil { - doBuild() - me.sh.GoodExit("") + s, err = doBuild() } if argv.Git != nil { initMachine() - me.sh.GoodExit("") - - s, err := doGit() - if err != nil { - me.sh.BadExit(s, err) - } - me.sh.GoodExit(s) + s, err = doGit() } if argv.PB != nil { - s, err := doIdentifyPB("unknown.pb") - if err != nil { - me.sh.BadExit(s, err) - } - me.sh.GoodExit(s) + s, err = doIdentifyPB("unknown.pb") } if argv.Clone != nil { @@ -107,8 +100,10 @@ func main() { } me.sh.GoodExit("do something here") } - - me.sh.GoodExit("do what?") + if err != nil { + me.sh.BadExit(s, err) + } + me.sh.GoodExit(s) } // this is dumb. sync this with go-deb |
