diff options
| -rw-r--r-- | argv.go | 9 | ||||
| -rw-r--r-- | config.text | 24 | ||||
| -rw-r--r-- | main.go | 4 | ||||
| -rw-r--r-- | structs.go | 4 |
4 files changed, 12 insertions, 29 deletions
@@ -11,7 +11,7 @@ package main import ( "os" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" ) var argv args @@ -45,18 +45,19 @@ func (args) Buildtime() (string, string) { } func (args) Version() string { - return ARGNAME + " " + VERSION + " Built on " + BUILDTIME + return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) } func (args) Appname() string { return ARGNAME } -func (a args) DoAutoComplete(pb *prep.Auto) { +// sends the strings to bash or zsh that will be your options +func (a args) SendCompletionStrings(pb *argvpb.Argv) { base := []string{"--dry-run", "--force", "incoming", "walk", "list", "everything", "verify", "newest", "--create", "--verbose", "release"} if pb.Cmd == "" { - pb.Autocomplete3(base) + pb.SendStrings(base) } else { pb.SubCommand(pb.Goargs...) } diff --git a/config.text b/config.text index 0941913..2bdd782 100644 --- a/config.text +++ b/config.text @@ -1,7 +1,3 @@ -# -# This is our WIT mirrors config file -# ~/.config/mirrors/config.text -# uuid: "3135d0f9-82a9-40b6-8aa1-b683ebe7bedd" version: "v0.0.2 go.wit.com/lib/config" configs: { @@ -9,21 +5,7 @@ configs: { value: "protobufs are neat" } configs: { - key: "mirrors.pb" - value: "/home/mirrors/wit/mirrors.wit.com.pb" + key: "Verbose" + value: "true" } -configs: { - key: "BaseDir" - value: "/home/mirrors/wit" -} -configs: { - key: "distPath" - value: "/home/mirrors/wit/dists/sid" -} -# YOUR GPG KEY -# Find it with: gpg --list-secret-keys --keyid-format=long -configs: { - key: "gpgKeyID" - value: "5D7C9BE47836D2FA48F83C2B4A854AEAF7E0E16D" -} -filename: "/root/.config/mirrors/config.text" +filename: "/home/jcarr/.config/mirrors/config.text" @@ -7,8 +7,8 @@ import ( "path/filepath" "go.wit.com/lib/config" - "go.wit.com/lib/gui/prep" "go.wit.com/lib/gui/shell" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" ) @@ -25,7 +25,7 @@ var resources embed.FS func main() { me = new(mainType) - me.sh = prep.Bash3(&argv) // add support for bash autocomplete with go-arg + me.sh = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args // read in protobuf file me.pb = zoopb.NewPackages() @@ -4,7 +4,7 @@ import ( "sync" "go.wit.com/lib/config" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/zoopb" ) @@ -13,7 +13,7 @@ var me *mainType // this app's variables type mainType struct { once sync.Once // one-time initialized data - sh *prep.Auto // more experiments for bash handling + sh *argvpb.Argv // shell autocomplete pb *zoopb.Packages // the mirrors packages config *config.Config // the mirrors packages } |
