From f3b553f90bfded3c1d9c62209a469017847352d8 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Tue, 7 Jul 2020 18:17:44 +0100 Subject: [PATCH] client/flags: remove NewCompletionCmd() The functionality was adopted tendermint upstream, see * https://github.com/tendermint/tendermint/pull/4665 --- CHANGELOG.md | 1 + client/flags/flags.go | 33 --------------------------------- simapp/simd/cmd/root.go | 2 +- 3 files changed, 2 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a257cac0eab..f53cda4880fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,6 +149,7 @@ be used to retrieve the actual proposal `Content`. Also the `NewMsgSubmitProposa * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. +* (client/flags) [\#6632](https://github.com/cosmos/cosmos-sdk/pull/6632) Remove NewCompletionCmd(), the function is now available in tendermint. ### Features diff --git a/client/flags/flags.go b/client/flags/flags.go index ad2562bff89a..2f20ab6c227a 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -2,7 +2,6 @@ package flags import ( "fmt" - "os" "strconv" "github.com/spf13/cobra" @@ -178,35 +177,3 @@ func ParseGas(gasStr string) (simulateAndExecute bool, gas uint64, err error) { } return } - -// NewCompletionCmd builds a cobra.Command that generate bash completion -// scripts for the given root command. If hidden is true, the command -// will not show up in the root command's list of available commands. -func NewCompletionCmd(rootCmd *cobra.Command, hidden bool) *cobra.Command { - flagZsh := "zsh" - cmd := &cobra.Command{ - Use: "completion", - Short: "Generate Bash/Zsh completion script to STDOUT", - Long: `To load completion script run - -. <(completion_script) - -To configure your bash shell to load completions for each session add to your bashrc - -# ~/.bashrc or ~/.profile -. <(completion_script) -`, - RunE: func(_ *cobra.Command, _ []string) error { - if viper.GetBool(flagZsh) { - return rootCmd.GenZshCompletion(os.Stdout) - } - return rootCmd.GenBashCompletion(os.Stdout) - }, - Hidden: hidden, - Args: cobra.NoArgs, - } - - cmd.Flags().Bool(flagZsh, false, "Generate Zsh completion script") - - return cmd -} diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 7244f445a3d1..79c206cab22a 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -79,7 +79,7 @@ func init() { genutilcli.GenTxCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome), genutilcli.ValidateGenesisCmd(simapp.ModuleBasics), AddGenesisAccountCmd(simapp.DefaultNodeHome), - flags.NewCompletionCmd(rootCmd, true), + cli.NewCompletionCmd(rootCmd, true), testnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}), debug.Cmd(), )