Skip to content

Commit

Permalink
cli: fix example command string
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
  • Loading branch information
sttts committed Aug 17, 2024
1 parent 2bc7a60 commit 8379b78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/kubectl-create-workspace/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
flags := pflag.NewFlagSet("kubectl-create-workspace", pflag.ExitOnError)
pflag.CommandLine = flags

createWorkspaceCmd, err := cmd.NewCreate(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr})
createWorkspaceCmd, err := cmd.NewCreate("kubectl create workspace", genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr})
if err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
Expand Down
6 changes: 3 additions & 3 deletions cli/pkg/workspace/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func New(streams genericclioptions.IOStreams) (*cobra.Command, error) {
}
currentWorkspaceOpts.BindFlags(currentCmd)

createCmd, err := NewCreate(streams)
createCmd, err := NewCreate(cliName+" workspace create", streams)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -206,12 +206,12 @@ func New(streams genericclioptions.IOStreams) (*cobra.Command, error) {
}

// NewCreate returns a cobra.Command for workspace create action.
func NewCreate(streams genericclioptions.IOStreams) (*cobra.Command, error) {
func NewCreate(prefix string, streams genericclioptions.IOStreams) (*cobra.Command, error) {
createWorkspaceOpts := plugin.NewCreateWorkspaceOptions(streams)
cmd := &cobra.Command{
Use: "create",
Short: "Creates a new workspace",
Example: "kcp workspace create <workspace name> [--type=<type>] [--enter [--ignore-not-ready]] --ignore-existing",
Example: prefix + " <workspace name> [--type=<type>] [--enter [--ignore-not-ready]] --ignore-existing",
SilenceUsage: true,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit 8379b78

Please sign in to comment.