diff options
| author | Jeff Carr <[email protected]> | 2025-09-17 01:09:03 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-17 01:09:03 -0500 |
| commit | 9f067d592ac6e3190206c6e7232ce95a04e7c25a (patch) | |
| tree | db56c4d337317051357a5b8ebe5b0fe2775b7247 /bash.go | |
| parent | 0c004de022cdedf04239f029b03bff1dfe3d7b30 (diff) | |
working on a better routine
Diffstat (limited to 'bash.go')
| -rw-r--r-- | bash.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -58,6 +58,27 @@ func Bash(argname string, autocomplete func([]string)) *BashAuto { return myBash } +// also try to parse/send cur (?) +func Bash2(argname string, autocomplete func(string, string, []string)) *BashAuto { + if len(os.Args) > 1 && os.Args[1] == "--bash" { + doBash(argname) + os.Exit(0) + } + + if len(os.Args) > 1 && os.Args[1] == "--auto-complete" { + autocomplete(os.Args[0], os.Args[1], os.Args[2:]) + os.Exit(0) + } + + arg.Register(&argBash) + + myBash = new(BashAuto) + myBash.appName = argname + + // parse go.Arg here? + return myBash +} + // returns the name of the executable registered for shell autocomplete func AppName() string { return myBash.appName |
