mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
Fix flags added multiple times (#2914)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2912 Global flags should not be added to the commands/subscommands, only globally.
This commit is contained in:
parent
adb2c82790
commit
a796885ad4
52 changed files with 55 additions and 120 deletions
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -33,7 +33,7 @@ var Command = &cli.Command{
|
|||
Usage: "deploy code",
|
||||
ArgsUsage: "<repo-id|repo-full-name> <pipeline> <environment>",
|
||||
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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> <pipeline>",
|
||||
Action: logPurge,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func logPurge(c *cli.Context) (err error) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> <pipeline>",
|
||||
Action: pipelineApprove,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func pipelineApprove(c *cli.Context) (err error) {
|
||||
|
|
|
@ -32,7 +32,7 @@ var pipelineCreateCmd = &cli.Command{
|
|||
Usage: "create new pipeline",
|
||||
ArgsUsage: "<repo-id|repo-full-name>",
|
||||
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 {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> <pipeline>",
|
||||
Action: pipelineDecline,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func pipelineDecline(c *cli.Context) (err error) {
|
||||
|
|
|
@ -30,9 +30,7 @@ var pipelineInfoCmd = &cli.Command{
|
|||
Usage: "show pipeline details",
|
||||
ArgsUsage: "<repo-id|repo-full-name> [pipeline]",
|
||||
Action: pipelineInfo,
|
||||
Flags: append(common.GlobalFlags,
|
||||
common.FormatFlag(tmplPipelineInfo),
|
||||
),
|
||||
Flags: []cli.Flag{common.FormatFlag(tmplPipelineInfo)},
|
||||
}
|
||||
|
||||
func pipelineInfo(c *cli.Context) error {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> <pipeline>",
|
||||
Action: pipelineKill,
|
||||
Hidden: true,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func pipelineKill(c *cli.Context) (err error) {
|
||||
|
|
|
@ -29,14 +29,14 @@ var pipelineLastCmd = &cli.Command{
|
|||
Usage: "show latest pipeline details",
|
||||
ArgsUsage: "<repo-id|repo-full-name>",
|
||||
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 {
|
||||
|
|
|
@ -29,7 +29,7 @@ var pipelineListCmd = &cli.Command{
|
|||
Usage: "show pipeline history",
|
||||
ArgsUsage: "<repo-id|repo-full-name>",
|
||||
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 {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> [pipeline] [stepID]",
|
||||
Action: pipelineLogs,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func pipelineLogs(c *cli.Context) error {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -30,9 +30,7 @@ var pipelinePsCmd = &cli.Command{
|
|||
Usage: "show pipeline steps",
|
||||
ArgsUsage: "<repo-id|repo-full-name> [pipeline]",
|
||||
Action: pipelinePs,
|
||||
Flags: append(common.GlobalFlags,
|
||||
common.FormatFlag(tmplPipelinePs),
|
||||
),
|
||||
Flags: []cli.Flag{common.FormatFlag(tmplPipelinePs)},
|
||||
}
|
||||
|
||||
func pipelinePs(c *cli.Context) error {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> [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) {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name> [pipeline]",
|
||||
Flags: common.GlobalFlags,
|
||||
Action: pipelineStop,
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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: "<forge-remote-id>",
|
||||
Action: repoAdd,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func repoAdd(c *cli.Context) error {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name>",
|
||||
Action: repoChown,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func repoChown(c *cli.Context) error {
|
||||
|
|
|
@ -29,9 +29,7 @@ var repoInfoCmd = &cli.Command{
|
|||
Usage: "show repository details",
|
||||
ArgsUsage: "<repo-id|repo-full-name>",
|
||||
Action: repoInfo,
|
||||
Flags: append(common.GlobalFlags,
|
||||
common.FormatFlag(tmplRepoInfo),
|
||||
),
|
||||
Flags: []cli.Flag{common.FormatFlag(tmplRepoInfo)},
|
||||
}
|
||||
|
||||
func repoInfo(c *cli.Context) error {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name>",
|
||||
Action: repoRepair,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func repoRepair(c *cli.Context) error {
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name>",
|
||||
Action: repoRemove,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func repoRemove(c *cli.Context) error {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: "<repo-id|repo-full-name>",
|
||||
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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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: "<username>",
|
||||
Action: userAdd,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func userAdd(c *cli.Context) error {
|
||||
|
|
|
@ -30,9 +30,7 @@ var userInfoCmd = &cli.Command{
|
|||
Usage: "show user details",
|
||||
ArgsUsage: "<username>",
|
||||
Action: userInfo,
|
||||
Flags: append(common.GlobalFlags,
|
||||
common.FormatFlag(tmplUserInfo),
|
||||
),
|
||||
Flags: []cli.Flag{common.FormatFlag(tmplUserInfo)},
|
||||
}
|
||||
|
||||
func userInfo(c *cli.Context) error {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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: "<username>",
|
||||
Action: userRemove,
|
||||
Flags: common.GlobalFlags,
|
||||
}
|
||||
|
||||
func userRemove(c *cli.Context) error {
|
||||
|
|
Loading…
Reference in a new issue