summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-21 15:48:09 -0500
committerJeff Carr <[email protected]>2025-10-21 15:48:09 -0500
commitceab4c25d57568aa5359cc92c2905ba2e8e3c3cf (patch)
tree67c5aadbfcce3cda1588457a445b16fcde12f340
parenta9af6f2ed2263f11bb13d2220df11402e269cef9 (diff)
basic IsMatch() kinda works
-rw-r--r--argv.custom.go8
-rw-r--r--argv.struct.go1
-rw-r--r--main.go2
3 files changed, 10 insertions, 1 deletions
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()