summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-29 02:47:50 -0500
committerJeff Carr <[email protected]>2025-10-29 02:47:50 -0500
commita72d983788e44cccdaa0f7310f8350355e7c32b3 (patch)
tree407ea50ccbaeda358309646d05e1078d89205ca6
parenta75e4796680ecf33b74db60b6b780d6e7e6cc0f3 (diff)
-rw-r--r--complete.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/complete.go b/complete.go
index 07147d2..265890d 100644
--- a/complete.go
+++ b/complete.go
@@ -17,34 +17,34 @@ var APPNAME string = "go-mod-clean"
func (a args) Description() string {
return `
-go-mod-clean will try to verify your go.* files are using the newest package versions
+go-mod-clean helps forge with the publishing of GO packages
-* Recreate go.* with 'go mod init' and 'go mod tidy'
-* Set your required go in go.mod (default is go1.21
-* Check that the most recent master branch versions are used
-* Try to trim go.sum of non-existent entries
+ * Recreate go.* with 'go mod init' and 'go mod tidy'
+ * Check that the most recent master branch versions are used
+ * can trim go.sum of non-existent entries
`
}
func (args) MustParse() error {
- me.pp = arg.MustParse(&argv)
+ me.pp = arg.MustParseArgv(&argv)
return nil
}
// sends the strings to bash or zsh that will be your options
func (a args) DoAutoComplete() error {
+ var err error
+ me.pp, err = arg.ParseFlagsArgv(&argv)
+ if err != nil {
+ fmt.Fprintf(argvpb.Stddbg, "go-args parseFlagsArgv(%v) finished autocomplete\n", err)
+ }
+ return err
+}
+
+func (args) Match() bool {
if argvpb.PB.GetCmd() == "" {
matches := []string{"strict", "--restore", "purge", "lax", "--version"}
fmt.Fprintf(argvpb.Stdout, " %s", strings.Join(matches, " "))
- return nil
- }
- var err error
- if me.pp == nil {
- me.pp, err = arg.ParseFlagsArgv(&argv)
- if err != nil {
- return err
- }
+ return true
}
- err = me.pp.WriteHelpForAutocomplete(argvpb.PB.Partial, argvpb.PB.Real...)
- return err
+ return false
}