// Copyright 2017-2025 WIT.COM Inc. All rights reserved. // Use of this source code is governed by the GPL 3.0 package main import ( "fmt" "strings" "go.wit.com/dev/alexflint/arg" "go.wit.com/lib/protobuf/argvpb" ) // sent via -ldflags var VERSION string var BUILDTIME string // used for shell auto completion var APPNAME string = "go-gui-toolkits" // todo: get this from $0 // 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) MustParse() error { me.pp = arg.MustParseArgv(&argv) return nil } func (args) Match() bool { if argvpb.PB.GetCmd() == "" { matches := []string{"all", "--verbose", "--version"} fmt.Fprintf(argvpb.Stdout, " %s", strings.Join(matches, " ")) return true } return false }