diff options
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/argv.go b/argv.go deleted file mode 100644 index 6d9e4ba..0000000 --- a/argv.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2017-2025 WIT.COM Inc. All rights reserved. -// Use of this source code is governed by the GPL 3.0 - -package main - -/* - this parses the command line arguements - this enables command line options from other packages like 'gui' and 'log' -*/ - -import ( - "os" - - "go.wit.com/lib/protobuf/argvpb" -) - -var argv args - -type args struct { - Drives *EmptyCmd `arg:"subcommand:drives" help:"list drives"` - // DebBuild *EmptyCmd `arg:"subcommand:debian" help:"build missing .deb packages"` - // 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"` - // 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"` - Release bool `arg:"--release" help:"use go-deb --release"` - DryRun bool `arg:"--dry-run" help:"only show what would be packaged"` - 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"` -} - -type EmptyCmd struct { -} - -/* - handles shell autocomplete -*/ - -func (args) Appname() string { - return ARGNAME -} - -func (args) Buildtime() (string, string) { - return BUILDTIME, VERSION -} - -func (args) Version() string { - return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) -} - -// sends the strings to bash or zsh that will be your options -func (a args) SendCompletionStrings(pb *argvpb.Argv) { - if pb.Cmd == "" { - base := []string{"drives", "gui", "--version"} - pb.SendStrings(base) - } else { - pb.SubCommand(pb.Goargs...) - } - os.Exit(0) -} |
