diff --git a/cmd/offboard/offboard.go b/cmd/offboard/offboard.go new file mode 100644 index 0000000..4e0390a --- /dev/null +++ b/cmd/offboard/offboard.go @@ -0,0 +1,37 @@ +package offboard + +import ( + "fmt" + "errors" + + "github.com/spf13/cobra" +) + +type Options struct { + offboardingUsers []string +} + +const configLongDesc string = `[WIP] Removes a user from the \".sauced.yaml\" config and \"CODEOWNERS\" files. +Requires the user's name OR email.` + +func NewConfigCommand() *cobra.Command { + options := &Options{} + cmd := &cobra.Command{ + Use: "offboard [flags]", + Short: "[WIP] Removes a user from the \".sauced.yaml\" config and \"CODEOWNERS\" files.", + Long: configLongDesc, + Args: func(_ *cobra.Command, args []string) error { + if !(len(args) > 0) { + errors.New("you must provide at least one argument: the offboarding user's email/username") + } + + options.offboardingUsers = args + + return nil + }, + RunE: func(cmd *cobra.Command, args []string) error { + return nil + }, + } + return cmd +} diff --git a/cmd/root/root.go b/cmd/root/root.go index d41a435..0cd054f 100644 --- a/cmd/root/root.go +++ b/cmd/root/root.go @@ -10,6 +10,7 @@ import ( "github.com/open-sauced/pizza-cli/v2/cmd/docs" "github.com/open-sauced/pizza-cli/v2/cmd/generate" "github.com/open-sauced/pizza-cli/v2/cmd/insights" + "github.com/open-sauced/pizza-cli/v2/cmd/offboard" "github.com/open-sauced/pizza-cli/v2/cmd/version" "github.com/open-sauced/pizza-cli/v2/pkg/constants" ) @@ -44,6 +45,7 @@ func NewRootCommand() (*cobra.Command, error) { cmd.AddCommand(generate.NewGenerateCommand()) cmd.AddCommand(insights.NewInsightsCommand()) cmd.AddCommand(version.NewVersionCommand()) + cmd.AddCommand(offboard.NewConfigCommand()) // The docs command is hidden as it's only used by the pizza-cli maintainers docsCmd := docs.NewDocsCommand()