diff options
| author | Jeff Carr <[email protected]> | 2025-09-09 08:41:15 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-09 08:41:15 -0500 |
| commit | e629211edd82f3910cff3c3db2c272a48c01fa56 (patch) | |
| tree | 37c746d27405b8ffb7adb521f7bfd1cd5ca3d731 /argv.go | |
| parent | 49820069c91df673727bc35d1ee0da395c278d4c (diff) | |
make args work again
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 35 |
1 files changed, 32 insertions, 3 deletions
@@ -9,6 +9,9 @@ package main */ import ( + "fmt" + "os" + "go.wit.com/lib/debugger" "go.wit.com/lib/gui/logsettings" "go.wit.com/log" @@ -22,6 +25,7 @@ type args struct { MacBuild *EmptyCmd `arg:"subcommand:macos" help:"build macos packages"` MakeInstall *EmptyCmd `arg:"subcommand:install" help:"run make install in each repo"` ListPkgs *EmptyCmd `arg:"subcommand:list" help:"list all the packages on mirrors.wit.com"` + Test *EmptyCmd `arg:"subcommand:test" help:"test build everything first"` Clone *EmptyCmd `arg:"subcommand:repomap-clone" help:"go-clone from a gowebd repomap"` Upgrade *EmptyCmd `arg:"subcommand:upgrade" help:"apt upgrade packages installed from mirrors.wit.com"` RepoMap string `arg:"--repomap" help:"location of the repomap"` @@ -30,10 +34,8 @@ type args struct { Verbose bool `arg:"--verbose" help:"be loud about it"` Force bool `arg:"--force" help:"rebuild everything"` Recursive bool `arg:"--recursive" help:"go-clone --recursive"` - Test bool `arg:"--test" help:"test build after everything else"` WITCOM bool `arg:"--witcom" help:"add the GPL header"` - Bash bool `arg:"--bash" help:"generate bash completion"` - BashAuto []string `arg:"--auto-complete" help:"does the actual autocompletion"` + Max int32 `arg:"--max" help:"stop building after max builds"` } type EmptyCmd struct { @@ -61,3 +63,30 @@ func init() { func (args) Version() string { return "wit-test " + VERSION + " Built on " + BUILDTIME } + +/* + handles shell autocomplete +*/ + +func (a args) DoAutoComplete(argv []string) { + switch argv[0] { + case "list": + fmt.Println("--all --mine --favorites --private") + case "debian": + fmt.Println("--dry-run --force --release --verbose macos --max") + case "upgrade": + fmt.Println("--dry-run") + case "build": + fmt.Println("--verbose --force") + case "install": + fmt.Println("--verbose") + case "repomap-clone": + fmt.Println("--repomap") + default: + if argv[0] == ARGNAME { + // list the subcommands here + fmt.Println("--bash list build debian install repomap-clone upgrade") + } + } + os.Exit(0) +} |
