summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-18 16:48:03 -0500
committerJeff Carr <[email protected]>2025-09-18 16:48:03 -0500
commitac16ef71277fafb4975d9e31be0dae2fffac1764 (patch)
tree01bbf0949858ebacb1f0e484fa89477972c2f51d
parent2ce32a0f2fb06c94bbb36e11b528093812df4453 (diff)
wow. this worked. thanks Alex Flint
-rw-r--r--argv.go18
-rw-r--r--main.go4
2 files changed, 8 insertions, 14 deletions
diff --git a/argv.go b/argv.go
index e1d5222..426b130 100644
--- a/argv.go
+++ b/argv.go
@@ -149,22 +149,12 @@ forge -- a tool to manage lots of git repos. forge includes a GUI and TUI.
`
}
-//
-// handles shell autocomplete
-//
-
-// arg0 should be the last entry
-// arg1 should be the 'current' thing the user is typing
-// it should be empty if the user doesn't have a partial string to match
+// handles shell autocomplete
func DoAutoComplete(pb *prep.Auto) {
switch pb.Cmd {
case "checkout":
pb.Autocomplete2("devel master user")
case "clean":
- // me.pp.WriteHelp(os.Stderr)
- // me.pp.WriteUsageForSubcommand(os.Stderr, me.pp.SubcommandNames()...)
- // me.pp.WriteHelpForSubcommand(os.Stderr, me.pp.SubcommandNames()...)
- // me.pp.WriteHelpForSubcommand(os.Stderr, "clean")
fmt.Println("--force verify --repo")
case "commit":
pb.Autocomplete2("--all")
@@ -200,12 +190,16 @@ func DoAutoComplete(pb *prep.Auto) {
if pb.Cmd == "" {
pb.Autocomplete2("help list checkout clean commit dirty fetch gui normal merge patch pull tag --gui")
} else {
- pb.Autocomplete2("todoGenericCmd")
+ pb.Autocomplete2("list checkout clean commit dirty normal merge")
}
}
os.Exit(0)
}
+func (args) Appname() string {
+ return ARGNAME
+}
+
func ifBlank(arg string) bool {
if arg == "''" {
// if empty, the user has not typed something
diff --git a/main.go b/main.go
index 8286376..244d12b 100644
--- a/main.go
+++ b/main.go
@@ -44,8 +44,8 @@ func getVersion(repo *gitpb.Repo, name string) string {
func main() {
me = new(mainType)
// prep.Bash2(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(&argv)
- me.myGui = prep.Gui() // prepares the GUI package for go-args
- me.auto = prep.Bash3(ARGNAME, argv.DoAutoComplete, &argv) // this line should be: prep.Bash(&argv)
+ me.myGui = prep.Gui() // prepares the GUI package for go-args
+ me.auto = prep.Bash3(argv.DoAutoComplete, &argv) // this line should be: prep.Bash(&argv)
// arg.MustParse(&argv) // these three lines are becoming terrible syntax
// me.auto = prep.MustParse(&argv) // try to make this work?