Skip to content

Commit

Permalink
Revert cli changes that weren't meant to be here.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Witkowski committed Nov 14, 2023
1 parent 3ce5d12 commit de4ba13
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
33 changes: 0 additions & 33 deletions cmd/provenanced/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand All @@ -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
Expand Down
21 changes: 0 additions & 21 deletions x/oracle/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit de4ba13

Please sign in to comment.