summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 05:03:12 -0500
committerJeff Carr <[email protected]>2025-09-25 05:03:12 -0500
commit2d5506b5fafd6eea6401ab3b253820c528882574 (patch)
tree4fe7bba9a9f5f9af57fdcb4945d9e5b0f0b964a4 /argv.go
parentfabf425958a25bc3b83104aad25cad8adbe31a89 (diff)
add bash autocompletev0.5.9v0.5.10
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/argv.go b/argv.go
index 0cb2c9b..8542fe5 100644
--- a/argv.go
+++ b/argv.go
@@ -3,6 +3,12 @@
package main
+import (
+ "os"
+
+ "go.wit.com/lib/gui/prep"
+)
+
/*
this parses the command line arguements
@@ -48,3 +54,20 @@ Example usage:
func (args) Version() string {
return "go.wit.com/apps/autogenpb " + VERSION + " Built on " + BUILDTIME
}
+
+/*
+ handles shell autocomplete
+*/
+
+func (args) Appname() string {
+ return ARGNAME
+}
+
+func (a args) DoAutoComplete(pb *prep.Auto) {
+ if pb.Cmd == "" {
+ pb.Autocomplete3([]string{"--bash", "--proto", "--regret", "--debug", "--delete", "--dry-run"})
+ } else {
+ pb.SubCommand(pb.Argv...)
+ }
+ os.Exit(0)
+}