diff options
| author | Jeff Carr <[email protected]> | 2025-09-08 16:18:45 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-08 16:18:45 -0500 |
| commit | cd4e1f9867776f245d8fb0938ec4999cd8e28d41 (patch) | |
| tree | 89ad495ad294876be158c9f5bcbd45c9667eb888 /argv.go | |
| parent | 132ebb1a11e6e28650cd56847c273a57bc461cc4 (diff) | |
use common bash functionv0.0.11
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -9,6 +9,10 @@ package main */ import ( + "fmt" + "os" + "strings" + "go.wit.com/lib/debugger" "go.wit.com/lib/gui/logsettings" "go.wit.com/log" @@ -61,3 +65,49 @@ func init() { func (args) Version() string { return ARGNAME + " " + VERSION + " Built on " + BUILDTIME } + +func (args) doBashAuto() { + argv.doBashHelp() + switch argv.BashAuto[0] { + case "list": + fmt.Println("--all --mine --favorites --private") + case "debian": + fmt.Println("--dry-run") + case "upgrade": + fmt.Println("--dry-run") + case "build": + fmt.Println("--verbose") + case "install": + fmt.Println("--verbose") + case "repomap-clone": + fmt.Println("--repomap") + default: + if strings.HasSuffix(argv.BashAuto[0], ARGNAME) { + // list the subcommands here + fmt.Println("--bash list build debian install repomap-clone upgrade") + } + } + os.Exit(0) +} + +// prints help to STDERR // TODO: move everything below this to go-args +func (args) doBashHelp() { + if argv.BashAuto[1] != "''" { + // if this is not blank, then the user has typed something + return + } + if argv.BashAuto[0] != ARGNAME { + // if this is not the name of the command, the user already started doing something + return + } + if argv.BashAuto[0] == ARGNAME { + // me.argpp.WriteHelp(os.Stderr) + // return + } + fmt.Fprintln(os.Stderr, "") + fmt.Fprintln(os.Stderr, "list: show every package on mirrors.wit.com") + fmt.Fprintln(os.Stderr, "build: go build every package that identifies as a binary") + fmt.Fprintln(os.Stderr, "install: go install every package into ~/go/bin") + fmt.Fprintln(os.Stderr, "repomap-clone: go-clone every package from a gowebd repomap") + fmt.Fprintln(os.Stderr, "") +} |
