From dada18c9a153db03f9cf52b6d4ba7e864bf5e3ba Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 25 Sep 2025 01:21:36 -0500 Subject: update to the new autocomplete --- argv.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'argv.go') diff --git a/argv.go b/argv.go index d951886..b7757fd 100644 --- a/argv.go +++ b/argv.go @@ -1,8 +1,9 @@ package main import ( - "fmt" "os" + + "go.wit.com/lib/gui/prep" ) /* @@ -44,19 +45,15 @@ the repositories in the go.sum file using git clone` handles shell autocomplete */ -func (a args) DoAutoComplete(argv []string) { - switch argv[0] { - case "arch": - fmt.Println("riscv64") - case "build": - fmt.Println("user devel release") - case "--gui": - fmt.Println("nocui andlabs") - default: - if argv[0] == ARGNAME { - // list the subcommands here - fmt.Println("arch build gui show --gui") - } +func (args) Appname() string { + return ARGNAME +} + +func (a args) DoAutoComplete(pb *prep.Auto) { + if pb.Cmd == "" { + pb.Autocomplete3([]string{"arch", "build", "gui", "show"}) + } else { + pb.SubCommand(pb.Argv...) } os.Exit(0) } -- cgit v1.2.3