diff options
| author | Jeff Carr <[email protected]> | 2025-10-19 04:48:28 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-19 04:48:28 -0500 |
| commit | 867b8dce9ea8f9f22718313691664f1f0e97e4c8 (patch) | |
| tree | d2d45fffa8e106475a09b766b6bf316aff92d56e /argv.custom.go | |
| parent | 2896bf0b1d58b27b331ea437c7c5a7d7318c8e43 (diff) | |
new argv
Diffstat (limited to 'argv.custom.go')
| -rw-r--r-- | argv.custom.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/argv.custom.go b/argv.custom.go new file mode 100644 index 0000000..75d4327 --- /dev/null +++ b/argv.custom.go @@ -0,0 +1,45 @@ +package main + +import ( + "os" + + "go.wit.com/lib/protobuf/argvpb" +) + +// sent via -ldflags +var VERSION string +var BUILDTIME string + +var APPNAME string = "go-clone" + +func (args) Version() string { + return "go-clone " + VERSION + " Built on " + BUILDTIME +} + +func (args) Buildtime() (string, string) { + return BUILDTIME, VERSION +} + +func (a args) Description() string { + return ` +git clone go repositories recursively + +Examples: + go-clone go.wit.com/apps/go-clone # 'git clone' go-clone +` +} + +func (args) Appname() string { + return APPNAME +} + +func (a args) DoAutoComplete(pb *argvpb.Argv) { + // fmt.Fprintf(os.Stderr, "blah\n") + // fmt.Fprintf(os.Stderr, "\n") + if pb.Cmd == "" { + pb.SendStrings([]string{"--dry-run", "--non-recursive", "--work", "--version"}) + } else { + pb.SubCommand(pb.Goargs...) + } + os.Exit(0) +} |
