diff --git a/cmd/helm/repo.go b/cmd/helm/repo.go index ad6ceaa8f..00368402b 100644 --- a/cmd/helm/repo.go +++ b/cmd/helm/repo.go @@ -45,6 +45,7 @@ func newRepoCmd(out io.Writer) *cobra.Command { cmd.AddCommand(newRepoRemoveCmd(out)) cmd.AddCommand(newRepoIndexCmd(out)) cmd.AddCommand(newRepoUpdateCmd(out)) + cmd.AddCommand(newRepoImportCmd(out)) return cmd } diff --git a/cmd/helm/repo_import.go b/cmd/helm/repo_import.go new file mode 100644 index 000000000..050dbf7fa --- /dev/null +++ b/cmd/helm/repo_import.go @@ -0,0 +1,55 @@ +/* +Copyright The Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "io" + + "github.com/spf13/cobra" + + "helm.sh/helm/v3/cmd/helm/require" +) + +type repoImportOptions struct { + filePath string +} + +func newRepoImportCmd(out io.Writer) *cobra.Command { + o := &repoImportOptions{} + + cmd := &cobra.Command{ + Use: "import [NAME]", + Aliases: []string{"im"}, + Short: "import chart repositories", + Args: require.ExactArgs(1), + ValidArgsFunction: noCompletions, // FIXME + RunE: func(cmd *cobra.Command, args []string) error { + o.filePath = args[0] + return o.run(out) + }, + } + + f := cmd.Flags() + f.StringVar(&o.filePath, "file", "", "path to the file to import") + + return cmd +} + +func (o *repoImportOptions) run(out io.Writer) error { + out.Write([]byte("repo import called\n")) + return nil +}