chore(comp): Remove unnecessary completion code

With the move to Cobra 1.1.1, all commands that have sub-commands
have file completion automatically disabled, so helm need not do it
itself.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
pull/9029/head
Marc Khouzam 4 years ago committed by Marc Khouzam
parent d675b9c810
commit b266c2ef0f

@ -73,11 +73,10 @@ var disableCompDescriptions bool
func newCompletionCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "completion",
Short: "generate autocompletions script for the specified shell",
Long: completionDesc,
Args: require.NoArgs,
ValidArgsFunction: noCompletions, // Disable file completion
Use: "completion",
Short: "generate autocompletions script for the specified shell",
Long: completionDesc,
Args: require.NoArgs,
}
bash := &cobra.Command{

@ -84,12 +84,11 @@ This will produce an error if the chart cannot be loaded.
func newDependencyCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "dependency update|build|list",
Aliases: []string{"dep", "dependencies"},
Short: "manage a chart's dependencies",
Long: dependencyDesc,
Args: require.NoArgs,
ValidArgsFunction: noCompletions, // Disable file completion
Use: "dependency update|build|list",
Aliases: []string{"dep", "dependencies"},
Short: "manage a chart's dependencies",
Long: dependencyDesc,
Args: require.NoArgs,
}
cmd.AddCommand(newDependencyListCmd(out))

@ -37,11 +37,10 @@ get extended information about the release, including:
func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "get",
Short: "download extended information of a named release",
Long: getHelp,
Args: require.NoArgs,
ValidArgsFunction: noCompletions, // Disable file completion
Use: "get",
Short: "download extended information of a named release",
Long: getHelp,
Args: require.NoArgs,
}
cmd.AddCommand(newGetAllCmd(cfg, out))

@ -32,10 +32,9 @@ Manage client-side Helm plugins.
func newPluginCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "plugin",
Short: "install, list, or uninstall Helm plugins",
Long: pluginHelp,
ValidArgsFunction: noCompletions, // Disable file completion
Use: "plugin",
Short: "install, list, or uninstall Helm plugins",
Long: pluginHelp,
}
cmd.AddCommand(
newPluginInstallCmd(out),

@ -34,11 +34,10 @@ It can be used to add, remove, list, and index chart repositories.
func newRepoCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "repo add|remove|list|index|update [ARGS]",
Short: "add, list, remove, update, and index chart repositories",
Long: repoHelm,
Args: require.NoArgs,
ValidArgsFunction: noCompletions, // Disable file completion
Use: "repo add|remove|list|index|update [ARGS]",
Short: "add, list, remove, update, and index chart repositories",
Long: repoHelm,
Args: require.NoArgs,
}
cmd.AddCommand(newRepoAddCmd(out))

@ -88,9 +88,6 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string
Short: "The Helm package manager for Kubernetes.",
Long: globalUsage,
SilenceUsage: true,
// This breaks completion for 'helm help <TAB>'
// The Cobra release following 1.0 will fix this
//ValidArgsFunction: noCompletions, // Disable file completion
}
flags := cmd.PersistentFlags()

@ -31,10 +31,9 @@ search subcommands to search different locations for charts.
func newSearchCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "search [keyword]",
Short: "search for a keyword in charts",
Long: searchDesc,
ValidArgsFunction: noCompletions, // Disable file completion
Use: "search [keyword]",
Short: "search for a keyword in charts",
Long: searchDesc,
}
cmd.AddCommand(newSearchHubCmd(out))

Loading…
Cancel
Save