1
0
Fork 0
mirror of https://github.com/drone/drone-cli.git synced 2024-05-26 16:56:02 +02:00

Merge pull request #59 from tboerger/arg-usage

Added proper arg usage
This commit is contained in:
Brad Rydzewski 2017-08-01 15:03:29 -04:00 committed by GitHub
commit 649de43693
33 changed files with 131 additions and 98 deletions

View File

@ -9,9 +9,10 @@ import (
)
var buildApproveCmd = cli.Command{
Name: "approve",
Usage: "approve a build",
Action: buildApprove,
Name: "approve",
Usage: "approve a build",
ArgsUsage: "<repo/name> <build>",
Action: buildApprove,
}
func buildApprove(c *cli.Context) (err error) {

View File

@ -9,9 +9,10 @@ import (
)
var buildDeclineCmd = cli.Command{
Name: "decline",
Usage: "decline a build",
Action: buildDecline,
Name: "decline",
Usage: "decline a build",
ArgsUsage: "<repo/name> <build>",
Action: buildDecline,
}
func buildDecline(c *cli.Context) (err error) {

View File

@ -10,9 +10,10 @@ import (
)
var buildInfoCmd = cli.Command{
Name: "info",
Usage: "show build details",
Action: buildInfo,
Name: "info",
Usage: "show build details",
ArgsUsage: "<repo/name> [build]",
Action: buildInfo,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -9,9 +9,10 @@ import (
)
var buildLastCmd = cli.Command{
Name: "last",
Usage: "show latest build details",
Action: buildLast,
Name: "last",
Usage: "show latest build details",
ArgsUsage: "<repo/name>",
Action: buildLast,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -9,9 +9,10 @@ import (
)
var buildListCmd = cli.Command{
Name: "list",
Usage: "show build history",
Action: buildList,
Name: "list",
Usage: "show build history",
ArgsUsage: "<repo/name>",
Action: buildList,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -7,9 +7,10 @@ import (
)
var buildLogsCmd = cli.Command{
Name: "logs",
Usage: "show build logs",
Action: buildLogs,
Name: "logs",
Usage: "show build logs",
ArgsUsage: "<repo/name> [build] [job]",
Action: buildLogs,
}
func buildLogs(c *cli.Context) error {

View File

@ -10,9 +10,10 @@ import (
)
var buildQueueCmd = cli.Command{
Name: "queue",
Usage: "show build queue",
Action: buildQueue,
Name: "queue",
Usage: "show build queue",
ArgsUsage: " ",
Action: buildQueue,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -11,9 +11,10 @@ import (
)
var buildStartCmd = cli.Command{
Name: "start",
Usage: "start a build",
Action: buildStart,
Name: "start",
Usage: "start a build",
ArgsUsage: "<repo/name> [build]",
Action: buildStart,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "fork",

View File

@ -9,9 +9,10 @@ import (
)
var buildStopCmd = cli.Command{
Name: "stop",
Usage: "stop a build",
Action: buildStop,
Name: "stop",
Usage: "stop a build",
ArgsUsage: "<repo/name> [build] [job]",
Action: buildStop,
}
func buildStop(c *cli.Context) (err error) {

View File

@ -14,9 +14,10 @@ import (
// Command exports the deploy command.
var Command = cli.Command{
Name: "deploy",
Usage: "deploy code",
Action: deploy,
Name: "deploy",
Usage: "deploy code",
ArgsUsage: "<repo/name> <build> <environment>",
Action: deploy,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -27,8 +27,9 @@ import (
// Command exports the exec command.
var Command = cli.Command{
Name: "exec",
Usage: "execute a local build",
Name: "exec",
Usage: "execute a local build",
ArgsUsage: "[path/to/.drone.yml]",
Action: func(c *cli.Context) {
if err := exec(c); err != nil {
log.Fatalln(err)

View File

@ -11,9 +11,10 @@ import (
// Command exports the info command.
var Command = cli.Command{
Name: "info",
Usage: "show information about the current user",
Action: info,
Name: "info",
Usage: "show information about the current user",
ArgsUsage: " ",
Action: info,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -11,9 +11,10 @@ import (
)
var registryCreateCmd = cli.Command{
Name: "add",
Usage: "adds a registry",
Action: registryCreate,
Name: "add",
Usage: "adds a registry",
ArgsUsage: "[repo/name]",
Action: registryCreate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -10,9 +10,10 @@ import (
)
var registryInfoCmd = cli.Command{
Name: "info",
Usage: "display registry info",
Action: registryInfo,
Name: "info",
Usage: "display registry info",
ArgsUsage: "[repo/name]",
Action: registryInfo,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -10,9 +10,10 @@ import (
)
var registryListCmd = cli.Command{
Name: "ls",
Usage: "list regitries",
Action: registryList,
Name: "ls",
Usage: "list regitries",
ArgsUsage: "[repo/name]",
Action: registryList,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -7,9 +7,10 @@ import (
)
var registryDeleteCmd = cli.Command{
Name: "rm",
Usage: "remove a registry",
Action: registryDelete,
Name: "rm",
Usage: "remove a registry",
ArgsUsage: "[repo/name]",
Action: registryDelete,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -11,9 +11,10 @@ import (
)
var registryUpdateCmd = cli.Command{
Name: "update",
Usage: "update a registry",
Action: registryUpdate,
Name: "update",
Usage: "update a registry",
ArgsUsage: "[repo/name]",
Action: registryUpdate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -8,9 +8,10 @@ import (
)
var repoAddCmd = cli.Command{
Name: "add",
Usage: "add a repository",
Action: repoAdd,
Name: "add",
Usage: "add a repository",
ArgsUsage: "<repo/name>",
Action: repoAdd,
}
func repoAdd(c *cli.Context) error {

View File

@ -8,9 +8,10 @@ import (
)
var repoChownCmd = cli.Command{
Name: "chown",
Usage: "assume ownership of a repository",
Action: repoChown,
Name: "chown",
Usage: "assume ownership of a repository",
ArgsUsage: "<repo/name>",
Action: repoChown,
}
func repoChown(c *cli.Context) error {

View File

@ -9,9 +9,10 @@ import (
)
var repoInfoCmd = cli.Command{
Name: "info",
Usage: "show repository details",
Action: repoInfo,
Name: "info",
Usage: "show repository details",
ArgsUsage: "<repo/name>",
Action: repoInfo,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -9,9 +9,10 @@ import (
)
var repoListCmd = cli.Command{
Name: "ls",
Usage: "list all repos",
Action: repoList,
Name: "ls",
Usage: "list all repos",
ArgsUsage: " ",
Action: repoList,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -6,9 +6,10 @@ import (
)
var repoRepairCmd = cli.Command{
Name: "repair",
Usage: "repair repository webhooks",
Action: repoRepair,
Name: "repair",
Usage: "repair repository webhooks",
ArgsUsage: "<repo/name>",
Action: repoRepair,
}
func repoRepair(c *cli.Context) error {

View File

@ -9,9 +9,10 @@ import (
)
var repoRemoveCmd = cli.Command{
Name: "rm",
Usage: "remove a repository",
Action: repoRemove,
Name: "rm",
Usage: "remove a repository",
ArgsUsage: "<repo/name>",
Action: repoRemove,
}
func repoRemove(c *cli.Context) error {

View File

@ -11,9 +11,10 @@ import (
)
var repoUpdateCmd = cli.Command{
Name: "update",
Usage: "update a repository",
Action: repoUpdate,
Name: "update",
Usage: "update a repository",
ArgsUsage: "<repo/name>",
Action: repoUpdate,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "trusted",

View File

@ -11,9 +11,10 @@ import (
)
var secretCreateCmd = cli.Command{
Name: "add",
Usage: "adds a secret",
Action: secretCreate,
Name: "add",
Usage: "adds a secret",
ArgsUsage: "[repo/name]",
Action: secretCreate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -10,9 +10,10 @@ import (
)
var secretInfoCmd = cli.Command{
Name: "info",
Usage: "display secret info",
Action: secretInfo,
Name: "info",
Usage: "display secret info",
ArgsUsage: "[repo/name]",
Action: secretInfo,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -11,9 +11,10 @@ import (
)
var secretListCmd = cli.Command{
Name: "ls",
Usage: "list secrets",
Action: secretList,
Name: "ls",
Usage: "list secrets",
ArgsUsage: "[repo/name]",
Action: secretList,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -7,9 +7,10 @@ import (
)
var secretDeleteCmd = cli.Command{
Name: "rm",
Usage: "remove a secret",
Action: secretDelete,
Name: "rm",
Usage: "remove a secret",
ArgsUsage: "[repo/name]",
Action: secretDelete,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -11,9 +11,10 @@ import (
)
var secretUpdateCmd = cli.Command{
Name: "update",
Usage: "update a secret",
Action: secretUpdate,
Name: "update",
Usage: "update a secret",
ArgsUsage: "[repo/name]",
Action: secretUpdate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "repository",

View File

@ -10,9 +10,10 @@ import (
)
var userAddCmd = cli.Command{
Name: "add",
Usage: "adds a user",
Action: userAdd,
Name: "add",
Usage: "adds a user",
ArgsUsage: "<username>",
Action: userAdd,
}
func userAdd(c *cli.Context) error {

View File

@ -11,9 +11,10 @@ import (
)
var userInfoCmd = cli.Command{
Name: "info",
Usage: "show user details",
Action: userInfo,
Name: "info",
Usage: "show user details",
ArgsUsage: "<username>",
Action: userInfo,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -10,9 +10,10 @@ import (
)
var userListCmd = cli.Command{
Name: "ls",
Usage: "list all users",
Action: userList,
Name: "ls",
Usage: "list all users",
ArgsUsage: " ",
Action: userList,
Flags: []cli.Flag{
cli.StringFlag{
Name: "format",

View File

@ -9,9 +9,10 @@ import (
)
var userRemoveCmd = cli.Command{
Name: "rm",
Usage: "remove a user",
Action: userRemove,
Name: "rm",
Usage: "remove a user",
ArgsUsage: "<username>",
Action: userRemove,
}
func userRemove(c *cli.Context) error {