wow. this worked. thanks Alex Flint
This commit is contained in:
parent
2ce32a0f2f
commit
ac16ef7127
18
argv.go
18
argv.go
|
@ -149,22 +149,12 @@ forge -- a tool to manage lots of git repos. forge includes a GUI and TUI.
|
|||
`
|
||||
}
|
||||
|
||||
//
|
||||
// handles shell autocomplete
|
||||
//
|
||||
|
||||
// arg0 should be the last entry
|
||||
// arg1 should be the 'current' thing the user is typing
|
||||
// it should be empty if the user doesn't have a partial string to match
|
||||
// handles shell autocomplete
|
||||
func DoAutoComplete(pb *prep.Auto) {
|
||||
switch pb.Cmd {
|
||||
case "checkout":
|
||||
pb.Autocomplete2("devel master user")
|
||||
case "clean":
|
||||
// me.pp.WriteHelp(os.Stderr)
|
||||
// me.pp.WriteUsageForSubcommand(os.Stderr, me.pp.SubcommandNames()...)
|
||||
// me.pp.WriteHelpForSubcommand(os.Stderr, me.pp.SubcommandNames()...)
|
||||
// me.pp.WriteHelpForSubcommand(os.Stderr, "clean")
|
||||
fmt.Println("--force verify --repo")
|
||||
case "commit":
|
||||
pb.Autocomplete2("--all")
|
||||
|
@ -200,12 +190,16 @@ func DoAutoComplete(pb *prep.Auto) {
|
|||
if pb.Cmd == "" {
|
||||
pb.Autocomplete2("help list checkout clean commit dirty fetch gui normal merge patch pull tag --gui")
|
||||
} else {
|
||||
pb.Autocomplete2("todoGenericCmd")
|
||||
pb.Autocomplete2("list checkout clean commit dirty normal merge")
|
||||
}
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func (args) Appname() string {
|
||||
return ARGNAME
|
||||
}
|
||||
|
||||
func ifBlank(arg string) bool {
|
||||
if arg == "''" {
|
||||
// if empty, the user has not typed something
|
||||
|
|
4
main.go
4
main.go
|
@ -44,8 +44,8 @@ func getVersion(repo *gitpb.Repo, name string) string {
|
|||
func main() {
|
||||
me = new(mainType)
|
||||
// prep.Bash2(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(&argv)
|
||||
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
||||
me.auto = prep.Bash3(ARGNAME, argv.DoAutoComplete, &argv) // this line should be: prep.Bash(&argv)
|
||||
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
||||
me.auto = prep.Bash3(argv.DoAutoComplete, &argv) // this line should be: prep.Bash(&argv)
|
||||
// arg.MustParse(&argv) // these three lines are becoming terrible syntax
|
||||
// me.auto = prep.MustParse(&argv) // try to make this work?
|
||||
|
||||
|
|
Loading…
Reference in New Issue