summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-17 01:08:30 -0500
committerJeff Carr <[email protected]>2025-09-17 01:08:30 -0500
commitce0fd10064440ebce0fe4941bb15cf4beb14540a (patch)
tree738c8d52819fb7158762480a68962efd0312e6cd /argv.go
parentae2cbf1886cb6bd71647c7d6ce1ed55f016c5618 (diff)
common argv handling
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/argv.go b/argv.go
index 6f34737..ac5419c 100644
--- a/argv.go
+++ b/argv.go
@@ -6,6 +6,7 @@ package main
import (
"fmt"
"os"
+ "strings"
)
/*
@@ -151,7 +152,12 @@ forge -- a tool to manage lots of git repos. forge includes a GUI and TUI.
// handles shell autocomplete
//
-func DoAutoComplete(argv []string) {
+func DoAutoComplete(arg0 string, arg1 string, argv []string) {
+ if strings.HasPrefix(argv[0], "-") {
+ fmt.Fprintf(os.Stderr, "stuff --gui --all '%s' '%s' %v\n", arg0, arg1, argv)
+ fmt.Println("--all --gui")
+ return
+ }
switch argv[0] {
case "checkout":
fmt.Println("devel master user")
@@ -214,6 +220,6 @@ func ifBlank(arg string) bool {
return false
}
-func (a args) DoAutoComplete(argv []string) {
- DoAutoComplete(argv)
+func (a args) DoAutoComplete(arg0 string, arg1 string, argv []string) {
+ DoAutoComplete(arg0, arg1, argv)
}