summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 02:09:19 -0500
committerJeff Carr <[email protected]>2025-09-25 02:09:19 -0500
commit7bf204299f01a0739c435d3768277c279c6291d3 (patch)
tree6224a1c93434c8b7cd638557c37cc2022dc08a47 /argv.go
parent94bd4728ba260bbda7643e51f1beb9629b6b90d5 (diff)
new bash autocompletev0.0.28v0.0.27v0.0.26v0.0.25
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go25
1 files changed, 15 insertions, 10 deletions
diff --git a/argv.go b/argv.go
index 50936c0..727a063 100644
--- a/argv.go
+++ b/argv.go
@@ -4,8 +4,9 @@
package main
import (
- "fmt"
"os"
+
+ "go.wit.com/lib/gui/prep"
)
/*
@@ -42,15 +43,19 @@ and with the right geometries. TODO: restore the bash working paths
`
}
-func (a args) DoAutoComplete(argv []string) {
- switch argv[0] {
- case "dump":
- fmt.Println("--terminals")
- default:
- if argv[0] == ARGNAME {
- // list the subcommands here
- fmt.Println("--restore save dump dumpx list")
- }
+/*
+ handles shell autocomplete
+*/
+
+func (args) Appname() string {
+ return ARGNAME
+}
+
+func (a args) DoAutoComplete(pb *prep.Auto) {
+ if pb.Cmd == "" {
+ pb.Autocomplete3([]string{"--restore", "save", "dump", "dumpx", "list"})
+ } else {
+ pb.SubCommand(pb.Argv...)
}
os.Exit(0)
}