cli: add command to generate shell completion scripts (#4665)

How to use it:

```
$ . <(tendermint completion)
```

Note that the completion command does not show up in the help screen,
though it comes with its own --help option.

This is a port of the feature provided by cosmos-sdk.
This commit is contained in:
Alessio Treglia
2020-04-13 16:08:23 +04:00
committed by GitHub
parent ef56e66611
commit fcbce21534
3 changed files with 44 additions and 2 deletions
+2 -2
View File
@@ -4,11 +4,10 @@ import (
"os"
"path/filepath"
"github.com/tendermint/tendermint/libs/cli"
cmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
"github.com/tendermint/tendermint/cmd/tendermint/commands/debug"
cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/libs/cli"
nm "github.com/tendermint/tendermint/node"
)
@@ -29,6 +28,7 @@ func main() {
cmd.GenNodeKeyCmd,
cmd.VersionCmd,
debug.DebugCmd,
cli.NewCompletionCmd(rootCmd, true),
)
// NOTE: