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
|
||||||
// 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
|
|
||||||
func DoAutoComplete(pb *prep.Auto) {
|
func DoAutoComplete(pb *prep.Auto) {
|
||||||
switch pb.Cmd {
|
switch pb.Cmd {
|
||||||
case "checkout":
|
case "checkout":
|
||||||
pb.Autocomplete2("devel master user")
|
pb.Autocomplete2("devel master user")
|
||||||
case "clean":
|
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")
|
fmt.Println("--force verify --repo")
|
||||||
case "commit":
|
case "commit":
|
||||||
pb.Autocomplete2("--all")
|
pb.Autocomplete2("--all")
|
||||||
|
@ -200,12 +190,16 @@ func DoAutoComplete(pb *prep.Auto) {
|
||||||
if pb.Cmd == "" {
|
if pb.Cmd == "" {
|
||||||
pb.Autocomplete2("help list checkout clean commit dirty fetch gui normal merge patch pull tag --gui")
|
pb.Autocomplete2("help list checkout clean commit dirty fetch gui normal merge patch pull tag --gui")
|
||||||
} else {
|
} else {
|
||||||
pb.Autocomplete2("todoGenericCmd")
|
pb.Autocomplete2("list checkout clean commit dirty normal merge")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (args) Appname() string {
|
||||||
|
return ARGNAME
|
||||||
|
}
|
||||||
|
|
||||||
func ifBlank(arg string) bool {
|
func ifBlank(arg string) bool {
|
||||||
if arg == "''" {
|
if arg == "''" {
|
||||||
// if empty, the user has not typed something
|
// 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() {
|
func main() {
|
||||||
me = new(mainType)
|
me = new(mainType)
|
||||||
// prep.Bash2(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(&argv)
|
// prep.Bash2(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(&argv)
|
||||||
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
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.auto = prep.Bash3(argv.DoAutoComplete, &argv) // this line should be: prep.Bash(&argv)
|
||||||
// arg.MustParse(&argv) // these three lines are becoming terrible syntax
|
// arg.MustParse(&argv) // these three lines are becoming terrible syntax
|
||||||
// me.auto = prep.MustParse(&argv) // try to make this work?
|
// me.auto = prep.MustParse(&argv) // try to make this work?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue