From de4ba1344b9a7ebaf003ab14cdce7d325cdf21d4 Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Tue, 14 Nov 2023 15:13:59 -0500 Subject: [PATCH] Revert cli changes that weren't meant to be here. --- cmd/provenanced/cmd/root.go | 33 --------------------------------- x/oracle/client/cli/tx.go | 21 --------------------- 2 files changed, 54 deletions(-) diff --git a/cmd/provenanced/cmd/root.go b/cmd/provenanced/cmd/root.go index 42eee53541..da030bcbdb 100644 --- a/cmd/provenanced/cmd/root.go +++ b/cmd/provenanced/cmd/root.go @@ -101,7 +101,6 @@ func NewRootCmd(sealConfig bool) (*cobra.Command, params.EncodingConfig) { return nil }, } - genAutoCompleteCmd(rootCmd) initRootCmd(rootCmd, encodingConfig) overwriteFlagDefaults(rootCmd, map[string]string{ flags.FlagChainID: "", @@ -112,38 +111,6 @@ func NewRootCmd(sealConfig bool) (*cobra.Command, params.EncodingConfig) { return rootCmd, encodingConfig } -func genAutoCompleteCmd(rootCmd *cobra.Command) { - rootCmd.AddCommand(&cobra.Command{ - Use: "enable-cli-autocomplete [bash|zsh|fish|powershell]", - Short: "Generates cli completion scripts", - Long: `To configure your shell to load completions for each session, add to your profile: - -# bash example -echo '. <(provenanced enable-cli-autocomplete bash)' >> ~/.bash_profile -source ~/.bash_profile - -# zsh example -echo '. <(provenanced enable-cli-autocomplete zsh)' >> ~/.zshrc -source ~/.zshrc -`, - DisableFlagsInUseLine: true, - ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, - Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { - switch args[0] { - case "bash": - _ = cmd.Root().GenBashCompletion(os.Stdout) - case "zsh": - _ = cmd.Root().GenZshCompletion(os.Stdout) - case "fish": - _ = cmd.Root().GenFishCompletion(os.Stdout, true) - case "powershell": - _ = cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) - } - }, - }) -} - // Execute executes the root command. func Execute(rootCmd *cobra.Command) error { // Create and set a client.Context on the command's Context. During the pre-run diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go index 7e7b807c0e..ff1a63f0d3 100644 --- a/x/oracle/client/cli/tx.go +++ b/x/oracle/client/cli/tx.go @@ -17,7 +17,6 @@ import ( govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types" "github.com/provenance-io/provenance/x/oracle/types" ) @@ -88,26 +87,6 @@ func GetCmdSendQuery() *cobra.Command { Short: "Send a query to an oracle on a remote chain via IBC", Args: cobra.ExactArgs(2), Aliases: []string{"sq"}, - ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - if len(args) != 0 { - return nil, cobra.ShellCompDirectiveNoFileComp - } - clientCtx, _ := client.GetClientQueryContext(cmd) - queryClient := channeltypes.NewQueryClient(clientCtx) - - pageReq, _ := client.ReadPageRequest(cmd.Flags()) - - req := &channeltypes.QueryChannelsRequest{ - Pagination: pageReq, - } - - res, _ := queryClient.Channels(cmd.Context(), req) - channels := make([]string, len(res.Channels)) - for _, channel := range res.Channels { - channels = append(channels, channel.ChannelId) - } - return channels, cobra.ShellCompDirectiveNoFileComp - }, Example: fmt.Sprintf(`%[1]s tx oracle send-query channel-1 '{"query_version":{}}'`, version.AppName), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd)