Skip to content

Commit

Permalink
Add command autocompletion.
Browse files Browse the repository at this point in the history
This PR adds command autocompletion to the CLI.
  • Loading branch information
dadgar committed Jul 17, 2017
1 parent 2b91738 commit c0084dc
Show file tree
Hide file tree
Showing 27 changed files with 1,447 additions and 16 deletions.
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ func RunCustom(args []string, commands map[string]cli.CommandFactory) int {
}

cli := &cli.CLI{
Version: PrettyVersion(GetVersionParts()),
Args: args,
Commands: commands,
HelpFunc: cli.FilteredHelpFunc(commandsInclude, cli.BasicHelpFunc("nomad")),
Name: "nomad",
Version: PrettyVersion(GetVersionParts()),
Args: args,
Commands: commands,
Autocomplete: true,
HelpFunc: cli.FilteredHelpFunc(commandsInclude, cli.BasicHelpFunc("nomad")),
}

exitCode, err := cli.Run()
Expand Down
43 changes: 43 additions & 0 deletions vendor/github.com/mitchellh/cli/autocomplete.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

204 changes: 199 additions & 5 deletions vendor/github.com/mitchellh/cli/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/github.com/mitchellh/cli/command.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/mitchellh/cli/command_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c0084dc

Please sign in to comment.