Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion internal/cmd/cli/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"bytes"
"errors"
"flag"
"fmt"
"os"

Expand Down Expand Up @@ -33,10 +34,15 @@ type readFile func(name string) ([]byte, error)

// NewApply returns a subcommand to create bundles from directories
func NewApply() *cobra.Command {
return command.Command(&Apply{}, cobra.Command{
cmd := command.Command(&Apply{}, cobra.Command{
Use: "apply [flags] BUNDLE_NAME PATH...",
Short: "Create bundles from directories, and output them or apply them on a cluster",
})

fs := flag.NewFlagSet("", flag.ExitOnError)
ctrl.RegisterFlags(fs)
cmd.Flags().AddGoFlagSet(fs)
return cmd
}

type Apply struct {
Expand Down
17 changes: 15 additions & 2 deletions internal/cmd/cli/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"errors"
"flag"
"fmt"
"math"
"strconv"
Expand Down Expand Up @@ -32,21 +33,33 @@ func NewCleanUp() *cobra.Command {
}

func NewClusterRegistration() *cobra.Command {
return command.Command(&ClusterRegistration{}, cobra.Command{
cmd := command.Command(&ClusterRegistration{}, cobra.Command{
Use: "clusterregistration [flags]",
Short: "Clean up outdated cluster registrations",
SilenceUsage: true,
SilenceErrors: true,
})

fs := flag.NewFlagSet("", flag.ExitOnError)
zopts.BindFlags(fs)
ctrl.RegisterFlags(fs)
cmd.Flags().AddGoFlagSet(fs)
return cmd
}

func NewGitjob() *cobra.Command {
return command.Command(&Gitjob{}, cobra.Command{
cmd := command.Command(&Gitjob{}, cobra.Command{
Use: "gitjob [flags]",
Short: "Clean up outdated git jobs",
SilenceUsage: true,
SilenceErrors: true,
})

fs := flag.NewFlagSet("", flag.ExitOnError)
zopts.BindFlags(fs)
ctrl.RegisterFlags(fs)
cmd.Flags().AddGoFlagSet(fs)
return cmd
}

type Cleanup struct {
Expand Down