diff --git a/cmd/create.go b/cmd/create.go index 2c9657b..5886c5e 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -36,7 +36,7 @@ var createCmd = &cobra.Command{ ValidArgsFunction: validNouns, Long: `Create containers specified by the arguments. Arguments can be either container names or categories. Multiple arguments are supported.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { conts := config.Union(args) for _, c := range conts { fmt.Fprintln(output, "CREATE", c.Name) diff --git a/cmd/nouns.go b/cmd/nouns.go index 929e715..403f3db 100644 --- a/cmd/nouns.go +++ b/cmd/nouns.go @@ -26,7 +26,7 @@ import ( "github.com/spf13/cobra" ) -func validNouns(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func validNouns(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) { validArgs := []string{} for _, c := range config.Union([]string{}) { validArgs = append(validArgs, c.Name) diff --git a/cmd/recreate.go b/cmd/recreate.go index 3ae1b02..0f4210e 100644 --- a/cmd/recreate.go +++ b/cmd/recreate.go @@ -30,13 +30,13 @@ import ( // recreateCmd represents the recreate command var recreateCmd = &cobra.Command{ - Use: "recreate", - Short: "Recreate container images", + Use: "recreate", + Short: "Recreate container images", Args: cobra.OnlyValidArgs, ValidArgsFunction: validNouns, Long: `Recreate container images, stopping and restarting if necessary. Arguments can be one or more container names or categories. If empty, "all" is assumed.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { conts := config.Union(args) for _, c := range conts { fmt.Fprintln(output, "RECREATE", c.Name) diff --git a/cmd/restart.go b/cmd/restart.go index 3d389f9..e04ad92 100644 --- a/cmd/restart.go +++ b/cmd/restart.go @@ -30,13 +30,13 @@ import ( // restartCmd represents the restart command var restartCmd = &cobra.Command{ - Use: "restart", - Short: "Restart containers", + Use: "restart", + Short: "Restart containers", Args: cobra.OnlyValidArgs, ValidArgsFunction: validNouns, Long: `Stop configured containers (if running), then restart them. Arguments can be one or more container names or categories. If empty, "all" is assumed.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { conts := config.Union(args) for _, c := range conts { fmt.Fprintln(output, "RESTART", c.Name) @@ -52,14 +52,4 @@ one or more container names or categories. If empty, "all" is assumed.`, func init() { rootCmd.AddCommand(restartCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // restartCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // restartCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/start.go b/cmd/start.go index 8fcc095..68fbb25 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -36,7 +36,7 @@ var startCmd = &cobra.Command{ ValidArgsFunction: validNouns, Long: `Start configured containers. They must be created first. Arguments can be one or more container names or categories. If empty, "all" is assumed.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { conts := config.Union(args) for _, c := range conts { fmt.Fprintln(output, "START", c.Name) diff --git a/cmd/update.go b/cmd/update.go index 3ca6203..62bcbf7 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -36,7 +36,7 @@ var updateCmd = &cobra.Command{ ValidArgsFunction: validNouns, Long: `Update container images, stopping and restarting if necessary. Arguments can be one or more container names or categories. If empty, "all" is assumed.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { conts := config.Union(args) for _, c := range conts { fmt.Fprintln(output, "UPDATE", c.Name)