This commit is contained in:
Jeff Carr 2025-09-17 22:01:48 -05:00
parent 9bc6d030e5
commit f936a17bc0
2 changed files with 6 additions and 3 deletions

View File

@ -159,15 +159,18 @@ forge -- a tool to manage lots of git repos. forge includes a GUI and TUI.
// arg1 should be the 'current' thing the user is typing // 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 // it should be empty if the user doesn't have a partial string to match
func DoAutoComplete(autoArgv *prep.Auto) { func DoAutoComplete(autoArgv *prep.Auto) {
// autoArgv.FastHelp()
dur := autoArgv.Duration.AsDuration() dur := autoArgv.Duration.AsDuration()
if dur < time.Millisecond*300 { if dur < time.Millisecond*300 {
autoArgv.Debug = true autoArgv.Debug = true
autoArgv.Debugf("TODO: show extended help here '%s' '%s' %v dur=%v\n", autoArgv.Arg0, autoArgv.Arg1, autoArgv.Argv, shell.FormatDuration(dur)) autoArgv.Debugf("TODO: show extended help here '%s' '%s' %v dur=%v\n", autoArgv.Arg0, autoArgv.Arg1, autoArgv.Argv, shell.FormatDuration(dur))
autoArgv.AutoDebug()
} }
switch autoArgv.Argv[0] { switch autoArgv.Cmd {
case "checkout": case "checkout":
fmt.Println("devel master user") // argv.Checkout.Autocomplete("devel master user")
autoArgv.Autocomplete(argv.Checkout, "devel master user")
case "clean": case "clean":
// me.pp.WriteHelp(os.Stderr) // me.pp.WriteHelp(os.Stderr)
// me.pp.WriteUsageForSubcommand(os.Stderr, me.pp.SubcommandNames()...) // me.pp.WriteUsageForSubcommand(os.Stderr, me.pp.SubcommandNames()...)

View File

@ -44,7 +44,7 @@ func getVersion(repo *gitpb.Repo, name string) string {
func main() { func main() {
me = new(mainType) me = new(mainType)
prep.Bash2(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(argv) prep.Bash2(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(&argv)
me.myGui = prep.Gui() // prepares the GUI package for go-args me.myGui = prep.Gui() // prepares the GUI package for go-args
me.pp = arg.MustParse(&argv) me.pp = arg.MustParse(&argv)