mirror of https://github.com/status-im/consul.git
Autocomplete support
This commit is contained in:
parent
fd51793a48
commit
84ee8b8aff
8
main.go
8
main.go
|
@ -42,9 +42,11 @@ func realMain() int {
|
|||
}
|
||||
|
||||
cli := &cli.CLI{
|
||||
Args: args,
|
||||
Commands: command.Commands,
|
||||
HelpFunc: cli.FilteredHelpFunc(cmds, cli.BasicHelpFunc("consul")),
|
||||
Args: args,
|
||||
Commands: command.Commands,
|
||||
Autocomplete: true,
|
||||
Name: "consul",
|
||||
HelpFunc: cli.FilteredHelpFunc(cmds, cli.BasicHelpFunc("consul")),
|
||||
}
|
||||
|
||||
exitCode, err := cli.Run()
|
||||
|
|
|
@ -79,6 +79,23 @@ Command Options
|
|||
Joins a server to another server in the WAN pool.
|
||||
```
|
||||
|
||||
## Autocompletion
|
||||
|
||||
The `consul` command features opt-in subcommand autocompletion that you can
|
||||
enable for your shell with `consul -autocomplete-install`. After doing so,
|
||||
you can invoke a new shell and use the feature.
|
||||
|
||||
For example, assume a tab is typed at the end of each prompt line:
|
||||
|
||||
```
|
||||
$ consul e
|
||||
event exec
|
||||
|
||||
$ consul r
|
||||
raft reload rtt
|
||||
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
In addition to CLI flags, Consul reads environment variables for behavior
|
||||
|
|
Loading…
Reference in New Issue