From ceab4c25d57568aa5359cc92c2905ba2e8e3c3cf Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 21 Oct 2025 15:48:09 -0500 Subject: basic IsMatch() kinda works --- argv.custom.go | 8 ++++++++ argv.struct.go | 1 + main.go | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/argv.custom.go b/argv.custom.go index 63080d1..127d9a5 100644 --- a/argv.custom.go +++ b/argv.custom.go @@ -83,6 +83,14 @@ func (c CleanCmd) Match(partial string) []string { // sends the strings to bash or zsh that will be your options func (a args) SendCompletionStrings(pb *argvpb.Argv) { + if pb.IsMatch("mode.config") { + pb.SendStrings([]string{"mine", "favorites"}) + os.Exit(0) + } + if pb.IsMatch("mode") { + pb.SendStrings([]string{"once", "many", "mine", "favorites"}) + os.Exit(0) + } if pb.Cmd == "" { // these are base autocomplete strings matches := []string{"clean", "commit", "merge", "patch", "normal", "pull", "rebuild", "generate", "config"} diff --git a/argv.struct.go b/argv.struct.go index f545f44..ab5e83d 100644 --- a/argv.struct.go +++ b/argv.struct.go @@ -94,6 +94,7 @@ type ModeCmd struct { User *EmptyCmd `arg:"subcommand:user" help:"use user branches"` Normal *EmptyCmd `arg:"subcommand:normal" help:"use the 'normal' forge development mode"` Clean *EmptyCmd `arg:"subcommand:clean" help:"clean mode. removes everything to origin/HEAD"` + Config *EmptyCmd `arg:"subcommand:config" help:"select which config to use"` } type CommitCmd struct { diff --git a/main.go b/main.go index 74d179d..f7c4ab4 100644 --- a/main.go +++ b/main.go @@ -43,6 +43,7 @@ func doInit() *forgepb.Forge { } func doCoreChecks() { + ENV.PrintTable() me.forge.RescanRepos() // looks for new dirs, checks existing repos for changes // if you are in "normal" mode, always run normal every time to catch accidental errors @@ -56,7 +57,6 @@ func doCoreChecks() { } } else { if !me.forge.IsModeNormal() { - ENV.PrintTable() } if me.forge.IsModeDevel() { dumpDebug() -- cgit v1.2.3