mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-03-09 04:31:38 -05:00
Fix lint issues
This commit is contained in:
parent
6ed4f11da3
commit
d36f1ac0d5
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user