diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 09:41:12 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 09:41:12 -0500 |
| commit | 9ab7015f12dcf2d629dd878a845dd29708f980ff (patch) | |
| tree | c66c5c26c6815627e6824baac2f0de8d2bddf60d /structs.go | |
| parent | 99b510e5811290dd1d788a65f43af341c7361c51 (diff) | |
probably enough house cleaning. now to think.
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 44 |
1 files changed, 5 insertions, 39 deletions
@@ -1,60 +1,26 @@ package argvpb -// initializes logging and command line options - import ( - "strings" - "go.wit.com/dev/alexflint/arg" ) -/* -This struct can be used with the go-arg package. These -are the generic default command line arguments for the 'GUI' package -*/ -var argBash ArgsBash - -type ArgsBash struct { - Bash bool `arg:"--bash" help:"generate bash completion"` -} - -// returns the name of the executable registered for shell autocomplete -func AppName() string { - return me.ARGNAME -} - // try this struct out (?) var me *AutoArgs // this is a work in progress type AutoArgs struct { + pb *Argv // the protobuf for the current process + pp *arg.Parser // for parsing the command line args. Yay to alexf lint! id int // should be unique - hidden bool // don't update the toolkits when it's hidden Argv func([]string) // the function for shell autocomplete examples func() string // some examples appExit func() // app Exit() buildtime func() (string, string) // some examples - pp *arg.Parser // for parsing the command line args. Yay to alexf lint! autoFunc func(*Argv) // also a function for autocomplete guiFunc func() error // enables Gui functions - err error // store any errors from argv - pb *Argv - - ARGNAME string // a good way to track the name of the binary ? + ARGNAME string // a good way to track the name of the binary ? VERSION string BUILDTIME string -} - -// returns the last command (is blank if the current arg is not blank) -func GetLast(cur string, argv []string) string { - if cur != "''" { - return "" - } - for _, s := range argv { - if strings.HasPrefix(s, "-") { - continue - } - return s - } - return "" + err error // store any errors from argv + // hidden bool // don't update the toolkits when it's hidden } |
