diff --git a/cli/cron/cron.go b/cli/cron/cron.go index 580b9fe21..97b9ac43c 100644 --- a/cli/cron/cron.go +++ b/cli/cron/cron.go @@ -16,15 +16,12 @@ package cron import ( "github.com/urfave/cli/v2" - - "go.woodpecker-ci.org/woodpecker/v2/cli/common" ) // Command exports the cron command set. var Command = &cli.Command{ Name: "cron", Usage: "manage cron jobs", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ cronCreateCmd, cronDeleteCmd, diff --git a/cli/cron/cron_add.go b/cli/cron/cron_add.go index f26aa7bbb..2eb5eddd4 100644 --- a/cli/cron/cron_add.go +++ b/cli/cron/cron_add.go @@ -30,7 +30,7 @@ var cronCreateCmd = &cli.Command{ Usage: "add a cron job", ArgsUsage: "[repo-id|repo-full-name]", Action: cronCreate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "name", @@ -47,7 +47,7 @@ var cronCreateCmd = &cli.Command{ Required: true, }, common.FormatFlag(tmplCronList, true), - ), + }, } func cronCreate(c *cli.Context) error { diff --git a/cli/cron/cron_info.go b/cli/cron/cron_info.go index 126a03675..fd6f16bc1 100644 --- a/cli/cron/cron_info.go +++ b/cli/cron/cron_info.go @@ -29,7 +29,7 @@ var cronInfoCmd = &cli.Command{ Usage: "display info about a cron job", ArgsUsage: "[repo-id|repo-full-name]", Action: cronInfo, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "id", @@ -37,7 +37,7 @@ var cronInfoCmd = &cli.Command{ Required: true, }, common.FormatFlag(tmplCronList, true), - ), + }, } func cronInfo(c *cli.Context) error { diff --git a/cli/cron/cron_list.go b/cli/cron/cron_list.go index 33161d8ee..4a62e8c07 100644 --- a/cli/cron/cron_list.go +++ b/cli/cron/cron_list.go @@ -29,10 +29,10 @@ var cronListCmd = &cli.Command{ Usage: "list cron jobs", ArgsUsage: "[repo-id|repo-full-name]", Action: cronList, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, common.FormatFlag(tmplCronList, true), - ), + }, } func cronList(c *cli.Context) error { diff --git a/cli/cron/cron_rm.go b/cli/cron/cron_rm.go index 1428651e0..0e6fbc4c0 100644 --- a/cli/cron/cron_rm.go +++ b/cli/cron/cron_rm.go @@ -28,14 +28,14 @@ var cronDeleteCmd = &cli.Command{ Usage: "remove a cron job", ArgsUsage: "[repo-id|repo-full-name]", Action: cronDelete, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "id", Usage: "cron id", Required: true, }, - ), + }, } func cronDelete(c *cli.Context) error { diff --git a/cli/cron/cron_update.go b/cli/cron/cron_update.go index 94188e9fa..0c25f03f7 100644 --- a/cli/cron/cron_update.go +++ b/cli/cron/cron_update.go @@ -30,7 +30,7 @@ var cronUpdateCmd = &cli.Command{ Usage: "update a cron job", ArgsUsage: "[repo-id|repo-full-name]", Action: cronUpdate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "id", @@ -50,7 +50,7 @@ var cronUpdateCmd = &cli.Command{ Usage: "cron schedule", }, common.FormatFlag(tmplCronList, true), - ), + }, } func cronUpdate(c *cli.Context) error { diff --git a/cli/deploy/deploy.go b/cli/deploy/deploy.go index 5d5bf80b6..0ed963e62 100644 --- a/cli/deploy/deploy.go +++ b/cli/deploy/deploy.go @@ -33,7 +33,7 @@ var Command = &cli.Command{ Usage: "deploy code", ArgsUsage: " ", Action: deploy, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.FormatFlag(tmplDeployInfo), &cli.StringFlag{ Name: "branch", @@ -55,7 +55,7 @@ var Command = &cli.Command{ Aliases: []string{"p"}, Usage: "custom parameters to be injected into the step environment. Format: KEY=value", }, - ), + }, } func deploy(c *cli.Context) error { diff --git a/cli/exec/exec.go b/cli/exec/exec.go index d125ae936..96feb4dcc 100644 --- a/cli/exec/exec.go +++ b/cli/exec/exec.go @@ -48,7 +48,7 @@ var Command = &cli.Command{ Usage: "execute a local pipeline", ArgsUsage: "[path/to/.woodpecker.yaml]", Action: run, - Flags: utils.MergeSlices(common.GlobalFlags, flags, docker.Flags, kubernetes.Flags, local.Flags), + Flags: utils.MergeSlices(flags, docker.Flags, kubernetes.Flags, local.Flags), } func run(c *cli.Context) error { diff --git a/cli/info/info.go b/cli/info/info.go index ce5a4fcb7..e8d07145a 100644 --- a/cli/info/info.go +++ b/cli/info/info.go @@ -30,9 +30,7 @@ var Command = &cli.Command{ Usage: "show information about the current user", ArgsUsage: " ", Action: info, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplInfo, true), - ), + Flags: []cli.Flag{common.FormatFlag(tmplInfo, true)}, } func info(c *cli.Context) error { diff --git a/cli/lint/lint.go b/cli/lint/lint.go index 81ff0ba65..bef3c293e 100644 --- a/cli/lint/lint.go +++ b/cli/lint/lint.go @@ -37,7 +37,6 @@ var Command = &cli.Command{ Usage: "lint a pipeline configuration file", ArgsUsage: "[path/to/.woodpecker.yaml]", Action: lint, - Flags: common.GlobalFlags, } func lint(c *cli.Context) error { diff --git a/cli/log/log.go b/cli/log/log.go index 9c402b8f4..b9436c534 100644 --- a/cli/log/log.go +++ b/cli/log/log.go @@ -16,15 +16,12 @@ package log import ( "github.com/urfave/cli/v2" - - "go.woodpecker-ci.org/woodpecker/v2/cli/common" ) // Command exports the log command set. var Command = &cli.Command{ Name: "log", Usage: "manage logs", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ logPurgeCmd, }, diff --git a/cli/log/log_purge.go b/cli/log/log_purge.go index e95ff093a..7a3ebde6b 100644 --- a/cli/log/log_purge.go +++ b/cli/log/log_purge.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -29,7 +28,6 @@ var logPurgeCmd = &cli.Command{ Usage: "purge a log", ArgsUsage: " ", Action: logPurge, - Flags: common.GlobalFlags, } func logPurge(c *cli.Context) (err error) { diff --git a/cli/loglevel/loglevel.go b/cli/loglevel/loglevel.go index 79d6e1f6d..52b580b32 100644 --- a/cli/loglevel/loglevel.go +++ b/cli/loglevel/loglevel.go @@ -19,7 +19,6 @@ import ( "github.com/rs/zerolog/log" "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" "go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker" ) @@ -30,7 +29,6 @@ var Command = &cli.Command{ ArgsUsage: "[level]", Usage: "get the logging level of the server, or set it with [level]", Action: logLevel, - Flags: common.GlobalFlags, } func logLevel(c *cli.Context) error { diff --git a/cli/pipeline/approve.go b/cli/pipeline/approve.go index 1fcb701e2..4e2185b27 100644 --- a/cli/pipeline/approve.go +++ b/cli/pipeline/approve.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -29,7 +28,6 @@ var pipelineApproveCmd = &cli.Command{ Usage: "approve a pipeline", ArgsUsage: " ", Action: pipelineApprove, - Flags: common.GlobalFlags, } func pipelineApprove(c *cli.Context) (err error) { diff --git a/cli/pipeline/create.go b/cli/pipeline/create.go index 5707abcde..b268622eb 100644 --- a/cli/pipeline/create.go +++ b/cli/pipeline/create.go @@ -32,7 +32,7 @@ var pipelineCreateCmd = &cli.Command{ Usage: "create new pipeline", ArgsUsage: "", Action: pipelineCreate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.FormatFlag(tmplPipelineList), &cli.StringFlag{ Name: "branch", @@ -43,7 +43,7 @@ var pipelineCreateCmd = &cli.Command{ Name: "var", Usage: "key=value", }, - ), + }, } func pipelineCreate(c *cli.Context) error { diff --git a/cli/pipeline/decline.go b/cli/pipeline/decline.go index c730d2f4f..b99b13452 100644 --- a/cli/pipeline/decline.go +++ b/cli/pipeline/decline.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -29,7 +28,6 @@ var pipelineDeclineCmd = &cli.Command{ Usage: "decline a pipeline", ArgsUsage: " ", Action: pipelineDecline, - Flags: common.GlobalFlags, } func pipelineDecline(c *cli.Context) (err error) { diff --git a/cli/pipeline/info.go b/cli/pipeline/info.go index 7e0fae28e..2b1e9103f 100644 --- a/cli/pipeline/info.go +++ b/cli/pipeline/info.go @@ -30,9 +30,7 @@ var pipelineInfoCmd = &cli.Command{ Usage: "show pipeline details", ArgsUsage: " [pipeline]", Action: pipelineInfo, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplPipelineInfo), - ), + Flags: []cli.Flag{common.FormatFlag(tmplPipelineInfo)}, } func pipelineInfo(c *cli.Context) error { diff --git a/cli/pipeline/kill.go b/cli/pipeline/kill.go index 3648c11ec..3c8fa3fb9 100644 --- a/cli/pipeline/kill.go +++ b/cli/pipeline/kill.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -30,7 +29,6 @@ var pipelineKillCmd = &cli.Command{ ArgsUsage: " ", Action: pipelineKill, Hidden: true, - Flags: common.GlobalFlags, } func pipelineKill(c *cli.Context) (err error) { diff --git a/cli/pipeline/last.go b/cli/pipeline/last.go index 7e61544c2..a2c4b58bb 100644 --- a/cli/pipeline/last.go +++ b/cli/pipeline/last.go @@ -29,14 +29,14 @@ var pipelineLastCmd = &cli.Command{ Usage: "show latest pipeline details", ArgsUsage: "", Action: pipelineLast, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.FormatFlag(tmplPipelineInfo), &cli.StringFlag{ Name: "branch", Usage: "branch name", Value: "main", }, - ), + }, } func pipelineLast(c *cli.Context) error { diff --git a/cli/pipeline/list.go b/cli/pipeline/list.go index 1e685164f..5a2fbaf92 100644 --- a/cli/pipeline/list.go +++ b/cli/pipeline/list.go @@ -29,7 +29,7 @@ var pipelineListCmd = &cli.Command{ Usage: "show pipeline history", ArgsUsage: "", Action: pipelineList, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.FormatFlag(tmplPipelineList), &cli.StringFlag{ Name: "branch", @@ -48,7 +48,7 @@ var pipelineListCmd = &cli.Command{ Usage: "limit the list size", Value: 25, }, - ), + }, } func pipelineList(c *cli.Context) error { diff --git a/cli/pipeline/logs.go b/cli/pipeline/logs.go index 8001eadfe..8951b2052 100644 --- a/cli/pipeline/logs.go +++ b/cli/pipeline/logs.go @@ -18,10 +18,9 @@ import ( "fmt" "strconv" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" - "go.woodpecker-ci.org/woodpecker/v2/cli/internal" - "github.com/urfave/cli/v2" + + "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) var pipelineLogsCmd = &cli.Command{ @@ -29,7 +28,6 @@ var pipelineLogsCmd = &cli.Command{ Usage: "show pipeline logs", ArgsUsage: " [pipeline] [stepID]", Action: pipelineLogs, - Flags: common.GlobalFlags, } func pipelineLogs(c *cli.Context) error { diff --git a/cli/pipeline/pipeline.go b/cli/pipeline/pipeline.go index 64c91f7be..3b5061da6 100644 --- a/cli/pipeline/pipeline.go +++ b/cli/pipeline/pipeline.go @@ -16,15 +16,12 @@ package pipeline import ( "github.com/urfave/cli/v2" - - "go.woodpecker-ci.org/woodpecker/v2/cli/common" ) // Command exports the pipeline command set. var Command = &cli.Command{ Name: "pipeline", Usage: "manage pipelines", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ pipelineListCmd, pipelineLastCmd, diff --git a/cli/pipeline/ps.go b/cli/pipeline/ps.go index 940facb4d..abf83d347 100644 --- a/cli/pipeline/ps.go +++ b/cli/pipeline/ps.go @@ -30,9 +30,7 @@ var pipelinePsCmd = &cli.Command{ Usage: "show pipeline steps", ArgsUsage: " [pipeline]", Action: pipelinePs, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplPipelinePs), - ), + Flags: []cli.Flag{common.FormatFlag(tmplPipelinePs)}, } func pipelinePs(c *cli.Context) error { diff --git a/cli/pipeline/queue.go b/cli/pipeline/queue.go index 08e7b22ce..9678de7b1 100644 --- a/cli/pipeline/queue.go +++ b/cli/pipeline/queue.go @@ -30,9 +30,7 @@ var pipelineQueueCmd = &cli.Command{ Usage: "show pipeline queue", ArgsUsage: " ", Action: pipelineQueue, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplPipelineQueue), - ), + Flags: []cli.Flag{common.FormatFlag(tmplPipelineQueue)}, } func pipelineQueue(c *cli.Context) error { diff --git a/cli/pipeline/start.go b/cli/pipeline/start.go index a6e9f98a9..c3d870982 100644 --- a/cli/pipeline/start.go +++ b/cli/pipeline/start.go @@ -21,7 +21,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -30,13 +29,13 @@ var pipelineStartCmd = &cli.Command{ Usage: "start a pipeline", ArgsUsage: " [pipeline]", Action: pipelineStart, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.StringSliceFlag{ Name: "param", Aliases: []string{"p"}, Usage: "custom parameters to be injected into the step environment. Format: KEY=value", }, - ), + }, } func pipelineStart(c *cli.Context) (err error) { diff --git a/cli/pipeline/stop.go b/cli/pipeline/stop.go index 121b751b5..4d949f9cb 100644 --- a/cli/pipeline/stop.go +++ b/cli/pipeline/stop.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -28,7 +27,6 @@ var pipelineStopCmd = &cli.Command{ Name: "stop", Usage: "stop a pipeline", ArgsUsage: " [pipeline]", - Flags: common.GlobalFlags, Action: pipelineStop, } diff --git a/cli/registry/registry.go b/cli/registry/registry.go index da973aa6c..eb8a7d796 100644 --- a/cli/registry/registry.go +++ b/cli/registry/registry.go @@ -16,15 +16,12 @@ package registry import ( "github.com/urfave/cli/v2" - - "go.woodpecker-ci.org/woodpecker/v2/cli/common" ) // Command exports the registry command set. var Command = &cli.Command{ Name: "registry", Usage: "manage registries", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ registryCreateCmd, registryDeleteCmd, diff --git a/cli/registry/registry_add.go b/cli/registry/registry_add.go index 795b2da9a..c4c2e6688 100644 --- a/cli/registry/registry_add.go +++ b/cli/registry/registry_add.go @@ -30,7 +30,7 @@ var registryCreateCmd = &cli.Command{ Usage: "adds a registry", ArgsUsage: "[repo-id|repo-full-name]", Action: registryCreate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "hostname", @@ -45,7 +45,7 @@ var registryCreateCmd = &cli.Command{ Name: "password", Usage: "registry password", }, - ), + }, } func registryCreate(c *cli.Context) error { diff --git a/cli/registry/registry_info.go b/cli/registry/registry_info.go index add3e0697..8bbfceeba 100644 --- a/cli/registry/registry_info.go +++ b/cli/registry/registry_info.go @@ -29,7 +29,7 @@ var registryInfoCmd = &cli.Command{ Usage: "display registry info", ArgsUsage: "[repo-id|repo-full-name]", Action: registryInfo, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "hostname", @@ -37,7 +37,7 @@ var registryInfoCmd = &cli.Command{ Value: "docker.io", }, common.FormatFlag(tmplRegistryList, true), - ), + }, } func registryInfo(c *cli.Context) error { diff --git a/cli/registry/registry_list.go b/cli/registry/registry_list.go index 2c7f5afe9..f96238b70 100644 --- a/cli/registry/registry_list.go +++ b/cli/registry/registry_list.go @@ -29,10 +29,10 @@ var registryListCmd = &cli.Command{ Usage: "list registries", ArgsUsage: "[repo-id|repo-full-name]", Action: registryList, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, common.FormatFlag(tmplRegistryList, true), - ), + }, } func registryList(c *cli.Context) error { diff --git a/cli/registry/registry_rm.go b/cli/registry/registry_rm.go index 5bc1c1600..108c7b772 100644 --- a/cli/registry/registry_rm.go +++ b/cli/registry/registry_rm.go @@ -26,14 +26,14 @@ var registryDeleteCmd = &cli.Command{ Usage: "remove a registry", ArgsUsage: "[repo-id|repo-full-name]", Action: registryDelete, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "hostname", Usage: "registry hostname", Value: "docker.io", }, - ), + }, } func registryDelete(c *cli.Context) error { diff --git a/cli/registry/registry_set.go b/cli/registry/registry_set.go index b7c143cd9..5a4485b45 100644 --- a/cli/registry/registry_set.go +++ b/cli/registry/registry_set.go @@ -30,7 +30,7 @@ var registryUpdateCmd = &cli.Command{ Usage: "update a registry", ArgsUsage: "[repo-id|repo-full-name]", Action: registryUpdate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.RepoFlag, &cli.StringFlag{ Name: "hostname", @@ -45,7 +45,7 @@ var registryUpdateCmd = &cli.Command{ Name: "password", Usage: "registry password", }, - ), + }, } func registryUpdate(c *cli.Context) error { diff --git a/cli/repo/repo.go b/cli/repo/repo.go index ae760b944..43e8d5338 100644 --- a/cli/repo/repo.go +++ b/cli/repo/repo.go @@ -16,15 +16,12 @@ package repo import ( "github.com/urfave/cli/v2" - - "go.woodpecker-ci.org/woodpecker/v2/cli/common" ) // Command exports the repository command. var Command = &cli.Command{ Name: "repo", Usage: "manage repositories", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ repoListCmd, repoInfoCmd, diff --git a/cli/repo/repo_add.go b/cli/repo/repo_add.go index fac4d3a95..00094b40c 100644 --- a/cli/repo/repo_add.go +++ b/cli/repo/repo_add.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -29,7 +28,6 @@ var repoAddCmd = &cli.Command{ Usage: "add a repository", ArgsUsage: "", Action: repoAdd, - Flags: common.GlobalFlags, } func repoAdd(c *cli.Context) error { diff --git a/cli/repo/repo_chown.go b/cli/repo/repo_chown.go index dadc05077..050a3975a 100644 --- a/cli/repo/repo_chown.go +++ b/cli/repo/repo_chown.go @@ -19,7 +19,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -28,7 +27,6 @@ var repoChownCmd = &cli.Command{ Usage: "assume ownership of a repository", ArgsUsage: "", Action: repoChown, - Flags: common.GlobalFlags, } func repoChown(c *cli.Context) error { diff --git a/cli/repo/repo_info.go b/cli/repo/repo_info.go index 69ae2bfdc..ed308a4be 100644 --- a/cli/repo/repo_info.go +++ b/cli/repo/repo_info.go @@ -29,9 +29,7 @@ var repoInfoCmd = &cli.Command{ Usage: "show repository details", ArgsUsage: "", Action: repoInfo, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplRepoInfo), - ), + Flags: []cli.Flag{common.FormatFlag(tmplRepoInfo)}, } func repoInfo(c *cli.Context) error { diff --git a/cli/repo/repo_list.go b/cli/repo/repo_list.go index 747ce8fe5..2baa0670b 100644 --- a/cli/repo/repo_list.go +++ b/cli/repo/repo_list.go @@ -29,13 +29,13 @@ var repoListCmd = &cli.Command{ Usage: "list all repos", ArgsUsage: " ", Action: repoList, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ common.FormatFlag(tmplRepoList), &cli.StringFlag{ Name: "org", Usage: "filter by organization", }, - ), + }, } func repoList(c *cli.Context) error { diff --git a/cli/repo/repo_repair.go b/cli/repo/repo_repair.go index bc4936085..9cebc5853 100644 --- a/cli/repo/repo_repair.go +++ b/cli/repo/repo_repair.go @@ -19,7 +19,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -28,7 +27,6 @@ var repoRepairCmd = &cli.Command{ Usage: "repair repository webhooks", ArgsUsage: "", Action: repoRepair, - Flags: common.GlobalFlags, } func repoRepair(c *cli.Context) error { diff --git a/cli/repo/repo_rm.go b/cli/repo/repo_rm.go index 7c0177a1d..5603cd336 100644 --- a/cli/repo/repo_rm.go +++ b/cli/repo/repo_rm.go @@ -19,7 +19,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -28,7 +27,6 @@ var repoRemoveCmd = &cli.Command{ Usage: "remove a repository", ArgsUsage: "", Action: repoRemove, - Flags: common.GlobalFlags, } func repoRemove(c *cli.Context) error { diff --git a/cli/repo/repo_sync.go b/cli/repo/repo_sync.go index acb4801ab..14f13401f 100644 --- a/cli/repo/repo_sync.go +++ b/cli/repo/repo_sync.go @@ -29,9 +29,7 @@ var repoSyncCmd = &cli.Command{ Usage: "synchronize the repository list", ArgsUsage: " ", Action: repoSync, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplRepoList), - ), + Flags: []cli.Flag{common.FormatFlag(tmplRepoList)}, } // TODO: remove this and add an option to the list cmd as we do not store the remote repo list anymore diff --git a/cli/repo/repo_update.go b/cli/repo/repo_update.go index 6f1cdd886..51999bc76 100644 --- a/cli/repo/repo_update.go +++ b/cli/repo/repo_update.go @@ -20,7 +20,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" "go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker" ) @@ -30,7 +29,7 @@ var repoUpdateCmd = &cli.Command{ Usage: "update a repository", ArgsUsage: "", Action: repoUpdate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.BoolFlag{ Name: "trusted", Usage: "repository is trusted", @@ -59,7 +58,7 @@ var repoUpdateCmd = &cli.Command{ Name: "unsafe", Usage: "validate updating the pipeline-counter is unsafe", }, - ), + }, } func repoUpdate(c *cli.Context) error { diff --git a/cli/secret/secret.go b/cli/secret/secret.go index f953d0315..0e78d8d0d 100644 --- a/cli/secret/secret.go +++ b/cli/secret/secret.go @@ -21,7 +21,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" "go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker" ) @@ -30,7 +29,6 @@ import ( var Command = &cli.Command{ Name: "secret", Usage: "manage secrets", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ secretCreateCmd, secretDeleteCmd, diff --git a/cli/secret/secret_add.go b/cli/secret/secret_add.go index 8a49a29cb..7cd935396 100644 --- a/cli/secret/secret_add.go +++ b/cli/secret/secret_add.go @@ -30,7 +30,7 @@ var secretCreateCmd = &cli.Command{ Usage: "adds a secret", ArgsUsage: "[repo-id|repo-full-name]", Action: secretCreate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Usage: "global secret", @@ -53,7 +53,7 @@ var secretCreateCmd = &cli.Command{ Name: "image", Usage: "secret limited to these images", }, - ), + }, } func secretCreate(c *cli.Context) error { diff --git a/cli/secret/secret_info.go b/cli/secret/secret_info.go index fa14e4982..138dbb28e 100644 --- a/cli/secret/secret_info.go +++ b/cli/secret/secret_info.go @@ -30,7 +30,7 @@ var secretInfoCmd = &cli.Command{ Usage: "display secret info", ArgsUsage: "[repo-id|repo-full-name]", Action: secretInfo, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Usage: "global secret", @@ -42,7 +42,7 @@ var secretInfoCmd = &cli.Command{ Usage: "secret name", }, common.FormatFlag(tmplSecretList, true), - ), + }, } func secretInfo(c *cli.Context) error { diff --git a/cli/secret/secret_list.go b/cli/secret/secret_list.go index bcf7122fc..94a794f32 100644 --- a/cli/secret/secret_list.go +++ b/cli/secret/secret_list.go @@ -31,7 +31,7 @@ var secretListCmd = &cli.Command{ Usage: "list secrets", ArgsUsage: "[repo-id|repo-full-name]", Action: secretList, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Usage: "global secret", @@ -39,7 +39,7 @@ var secretListCmd = &cli.Command{ common.OrgFlag, common.RepoFlag, common.FormatFlag(tmplSecretList, true), - ), + }, } func secretList(c *cli.Context) error { diff --git a/cli/secret/secret_rm.go b/cli/secret/secret_rm.go index 3691eb95b..0dbc0c188 100644 --- a/cli/secret/secret_rm.go +++ b/cli/secret/secret_rm.go @@ -26,7 +26,7 @@ var secretDeleteCmd = &cli.Command{ Usage: "remove a secret", ArgsUsage: "[repo-id|repo-full-name]", Action: secretDelete, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Usage: "global secret", @@ -37,7 +37,7 @@ var secretDeleteCmd = &cli.Command{ Name: "name", Usage: "secret name", }, - ), + }, } func secretDelete(c *cli.Context) error { diff --git a/cli/secret/secret_set.go b/cli/secret/secret_set.go index 7923046c8..c1e0d1443 100644 --- a/cli/secret/secret_set.go +++ b/cli/secret/secret_set.go @@ -30,7 +30,7 @@ var secretUpdateCmd = &cli.Command{ Usage: "update a secret", ArgsUsage: "[repo-id|repo-full-name]", Action: secretUpdate, - Flags: append(common.GlobalFlags, + Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Usage: "global secret", @@ -53,7 +53,7 @@ var secretUpdateCmd = &cli.Command{ Name: "image", Usage: "secret limited to these images", }, - ), + }, } func secretUpdate(c *cli.Context) error { diff --git a/cli/user/user.go b/cli/user/user.go index 4d7f24313..a2323b672 100644 --- a/cli/user/user.go +++ b/cli/user/user.go @@ -16,15 +16,12 @@ package user import ( "github.com/urfave/cli/v2" - - "go.woodpecker-ci.org/woodpecker/v2/cli/common" ) // Command exports the user command set. var Command = &cli.Command{ Name: "user", Usage: "manage users", - Flags: common.GlobalFlags, Subcommands: []*cli.Command{ userListCmd, userInfoCmd, diff --git a/cli/user/user_add.go b/cli/user/user_add.go index 1baea6971..f3828b699 100644 --- a/cli/user/user_add.go +++ b/cli/user/user_add.go @@ -19,7 +19,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" "go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker" ) @@ -29,7 +28,6 @@ var userAddCmd = &cli.Command{ Usage: "adds a user", ArgsUsage: "", Action: userAdd, - Flags: common.GlobalFlags, } func userAdd(c *cli.Context) error { diff --git a/cli/user/user_info.go b/cli/user/user_info.go index 3e9b3f148..f7c92abca 100644 --- a/cli/user/user_info.go +++ b/cli/user/user_info.go @@ -30,9 +30,7 @@ var userInfoCmd = &cli.Command{ Usage: "show user details", ArgsUsage: "", Action: userInfo, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplUserInfo), - ), + Flags: []cli.Flag{common.FormatFlag(tmplUserInfo)}, } func userInfo(c *cli.Context) error { diff --git a/cli/user/user_list.go b/cli/user/user_list.go index b1cd7dc8b..914f04e63 100644 --- a/cli/user/user_list.go +++ b/cli/user/user_list.go @@ -29,9 +29,7 @@ var userListCmd = &cli.Command{ Usage: "list all users", ArgsUsage: " ", Action: userList, - Flags: append(common.GlobalFlags, - common.FormatFlag(tmplUserList), - ), + Flags: []cli.Flag{common.FormatFlag(tmplUserList)}, } func userList(c *cli.Context) error { diff --git a/cli/user/user_rm.go b/cli/user/user_rm.go index 128d74797..081b0cf23 100644 --- a/cli/user/user_rm.go +++ b/cli/user/user_rm.go @@ -19,7 +19,6 @@ import ( "github.com/urfave/cli/v2" - "go.woodpecker-ci.org/woodpecker/v2/cli/common" "go.woodpecker-ci.org/woodpecker/v2/cli/internal" ) @@ -28,7 +27,6 @@ var userRemoveCmd = &cli.Command{ Usage: "remove a user", ArgsUsage: "", Action: userRemove, - Flags: common.GlobalFlags, } func userRemove(c *cli.Context) error {