summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-19 05:08:00 -0500
committerJeff Carr <[email protected]>2025-10-19 05:08:00 -0500
commit2bbc498b02cbbe3ba68de391bffbe79ab0f226fc (patch)
tree3a09151aeb7a1294e83d61e847e74f9a982b837b /argv.go
parentc78eff62bb86594f71f9ff43ff151820ae8e94d9 (diff)
new argvv0.0.125
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go66
1 files changed, 0 insertions, 66 deletions
diff --git a/argv.go b/argv.go
deleted file mode 100644
index f7ed4f0..0000000
--- a/argv.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package main
-
-import (
- "os"
-
- "go.wit.com/lib/protobuf/argvpb"
-)
-
-/*
- this parses the command line arguements
-*/
-
-var argv args
-
-type args struct {
- Trim bool `arg:"--trim" default:"true" help:"trim entries from go.sum"`
- Verbose bool `arg:"--verbose" help:"show more"`
- Restore bool `arg:"--restore" help:"only restore from go/pkg/mod/"`
- Force bool `arg:"--force" help:"remove things and redo them no matter what"`
- Purge *EmptyCmd `arg:"subcommand:purge" help:"purge all git notes. (this is where the autogenerated files are stored)"`
- Smart *EmptyCmd `arg:"subcommand:lax" help:"try something but never do os.Exit(-1)"`
- Strict *EmptyCmd `arg:"subcommand:strict" help:"never make go.* files unless everything is perfect"`
- Bash bool `arg:"--bash" help:"generate bash completion"`
- BashAuto []string `arg:"--auto-complete" help:"todo: move this to go-arg"`
-}
-
-type EmptyCmd struct {
-}
-
-func (a args) Description() string {
- return `
-go-mod-clean will try to verify your go.* files are using the newest package versions
-
-* 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
-`
-}
-
-/*
- handles shell autocomplete
-*/
-
-func (args) Appname() string {
- return ARGNAME
-}
-
-func (args) Buildtime() (string, string) {
- return BUILDTIME, VERSION
-}
-
-func (args) Version() string {
- return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME)
-}
-
-// sends the strings to bash or zsh that will be your options
-func (a args) SendCompletionStrings(pb *argvpb.Argv) {
- if pb.Cmd == "" {
- base := []string{"strict", "--restore", "purge", "lax", "--version"}
- pb.SendStrings(base)
- } else {
- pb.SubCommand(pb.Goargs...)
- }
- os.Exit(0)
-}