diff options
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/argv.go b/argv.go deleted file mode 100644 index 1ac80c9..0000000 --- a/argv.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "os" - - "go.wit.com/lib/protobuf/argvpb" -) - -/* - this parses the command line arguements - this enables command line options from other packages like 'gui' and 'log' -*/ - -var argv args - -type args struct { - Test *EmptyCmd `arg:"subcommand:test" help:"test repomap"` - ListRepos bool `arg:"--list-repos" help:"list all repositories"` - Port int `arg:"--port" default:"2520" help:"port to run on"` - RepoMap string `arg:"--repomap" default:"/etc/gowebd/repomap" help:"repomap file"` - Hostname string `arg:"--hostname" default:"go.wit.com" help:"hostname to use"` -} - -type EmptyCmd struct { -} - -func (args) Version() string { - return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) -} - -func (args) Buildtime() (string, string) { - return BUILDTIME, VERSION -} - -func (args) Appname() string { - return ARGNAME -} - -// sends the strings to bash or zsh that will be your options -func (a args) SendCompletionStrings(pb *argvpb.Argv) { - if pb.Cmd == "" { - base := []string{"test", "--version", "--force"} - pb.SendStrings(base) - } else { - pb.SubCommand(pb.Goargs...) - } - os.Exit(0) -} |
