diff options
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 40 |
1 files changed, 12 insertions, 28 deletions
@@ -9,9 +9,9 @@ package main */ import ( - "fmt" "os" + "go.wit.com/lib/gui/prep" "go.wit.com/log" ) @@ -63,35 +63,19 @@ func init() { WARN = log.NewFlag("WARN", true, full, short, "bad things") } -// 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.pp.WriteHelp(os.Stderr) - return - } +/* + handles shell autocomplete +*/ + +func (args) Appname() string { + return ARGNAME } -func (args) DoAutoComplete(argv []string) { - switch argv[0] { - case "list": - fmt.Println("") - case "verify": - fmt.Println("on") - case "upgrade": - fmt.Println("") - default: - if argv[0] == ARGNAME { - // list the subcommands here - fmt.Println("help list") - } +func (a args) DoAutoComplete(pb *prep.Auto) { + if pb.Cmd == "" { + pb.Autocomplete3([]string{"gui", "list", "--daemon"}) + } else { + pb.SubCommand(pb.Argv...) } os.Exit(0) } |
