cert-manager/cmd/ctl/cmd.go
JoshVanL 19bc4734b6
Adds cert-manager-ctl with version command
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-04-01 18:54:19 +01:00

45 lines
1.3 KiB
Go

/* Copyright 2019 The Jetstack cert-manager contributors.
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"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/jetstack/cert-manager/cmd/ctl/pkg/version"
)
func NewCertManagerCtlCommand(in io.Reader, out, err io.Writer, stopCh <-chan struct{}) *cobra.Command {
cmds := &cobra.Command{
Use: "cert-manager-ctl",
Short: "cert-manager CLI tool to manage and configure cert-manager resources",
Long: `
cert-manager-ctl is a CLI tool managage and confiure cert-manager resources for Kubernetes`,
Run: runHelp,
}
ioStreams := genericclioptions.IOStreams{In: in, Out: out, ErrOut: err}
cmds.AddCommand(version.NewCmdVersion(ioStreams))
return cmds
}
func runHelp(cmd *cobra.Command, args []string) {
cmd.Help()
}