Skip to content

Commit

Permalink
Merge pull request #2848 from hashicorp/f-autocomplete
Browse files Browse the repository at this point in the history
Add command autocompletion.
  • Loading branch information
dadgar committed Jul 18, 2017
2 parents f722bbb + c0084dc commit 5b07d7f
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 5b07d7f

Please sign in to comment.