Skip to content

Commit

Permalink
chore(cli): Add examples of @latest alias for relevant commands. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rbreeze committed Jun 17, 2020
1 parent 17108df commit 4bd33c6
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 4 deletions.
7 changes: 7 additions & 0 deletions cmd/argo/commands/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ func NewDeleteCommand() *cobra.Command {
var command = &cobra.Command{
Use: "delete [--dry-run] [WORKFLOW...|[--all] [--older] [--completed] [--prefix PREFIX] [--selector SELECTOR]]",
Short: "delete workflows",
Example: `# Delete a workflow:
argo delete my-wf
# Delete the latest workflow:
argo delete @latest
`,
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
serviceClient := apiClient.NewWorkflowServiceClient()
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ func NewGetCommand() *cobra.Command {
var command = &cobra.Command{
Use: "get WORKFLOW...",
Short: "display details about a workflow",
Example: `# Get information about a workflow:
argo get my-wf
# Get the latest workflow:
argo get @latest
`,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
cmd.HelpFunc()(cmd, args)
Expand Down
2 changes: 2 additions & 0 deletions cmd/argo/commands/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func NewLogsCommand() *cobra.Command {
argo logs --since=1h my-pod
# Print the logs of the latest workflow:
argo logs @latest
`,
Run: func(cmd *cobra.Command, args []string) {

Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/resubmit.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ func NewResubmitCommand() *cobra.Command {
var command = &cobra.Command{
Use: "resubmit [WORKFLOW...]",
Short: "resubmit one or more workflows",
Example: `# Resubmit a workflow:
argo resubmit my-wf
# Resubmit the latest workflow:
argo resubmit @latest
`,
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
serviceClient := apiClient.NewWorkflowServiceClient()
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ func NewResumeCommand() *cobra.Command {
var command = &cobra.Command{
Use: "resume WORKFLOW1 WORKFLOW2...",
Short: "resume zero or more workflows",
Example: `# Resume a workflow that has been stopped or suspended:
argo resume my-wf
# Resume the latest workflow:
argo resume @latest
`,
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
serviceClient := apiClient.NewWorkflowServiceClient()
Expand Down
10 changes: 10 additions & 0 deletions cmd/argo/commands/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ func NewRetryCommand() *cobra.Command {
var command = &cobra.Command{
Use: "retry [WORKFLOW...]",
Short: "retry zero or more workflows",
Example: `# Retry a workflow:
argo retry my-wf
# Retry several workflows:
argo retry my-wf my-other-wf my-third-wf
# Retry the latest workflow:
argo retry @latest
`,
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
serviceClient := apiClient.NewWorkflowServiceClient()
Expand Down
7 changes: 3 additions & 4 deletions cmd/argo/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ const (
// NewCommand returns a new instance of an argo command
func NewCommand() *cobra.Command {
var command = &cobra.Command{
Use: CLIName,
Short: "argo is the command line interface to Argo",
Example: fmt.Sprintf(`
If you're using the Argo Server (e.g. because you need large workflow support or workflow archive), please read %s.`, help.CLI),
Use: CLIName,
Short: "argo is the command line interface to Argo",
Example: fmt.Sprintf(`If you're using the Argo Server (e.g. because you need large workflow support or workflow archive), please read %s.`, help.CLI),
Run: func(cmd *cobra.Command, args []string) {
cmd.HelpFunc()(cmd, args)
},
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ func NewStopCommand() *cobra.Command {
var command = &cobra.Command{
Use: "stop WORKFLOW WORKFLOW2...",
Short: "stop zero or more workflows",
Example: `# Stop about a workflow:
argo stop my-wf
# Stop the latest workflow:
argo stop @latest
`,
Run: func(cmd *cobra.Command, args []string) {

ctx, apiClient := client.NewAPIClient()
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/suspend.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ func NewSuspendCommand() *cobra.Command {
var command = &cobra.Command{
Use: "suspend WORKFLOW1 WORKFLOW2...",
Short: "suspend zero or more workflow",
Example: `# Suspend a workflow:
argo suspend my-wf
# Suspend the latest workflow:
argo suspend @latest
`,
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
serviceClient := apiClient.NewWorkflowServiceClient()
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/terminate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ func NewTerminateCommand() *cobra.Command {
var command = &cobra.Command{
Use: "terminate WORKFLOW WORKFLOW2...",
Short: "terminate zero or more workflows",
Example: `# Terminate a workflow:
argo terminate my-wf
# Terminate the latest workflow:
argo terminate @latest
`,
Run: func(cmd *cobra.Command, args []string) {

ctx, apiClient := client.NewAPIClient()
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ func NewWaitCommand() *cobra.Command {
var command = &cobra.Command{
Use: "wait [WORKFLOW...]",
Short: "waits for workflows to complete",
Example: `# Wait on a workflow:
argo wait my-wf
# Wait on the latest workflow:
argo wait @latest
`,
Run: func(cmd *cobra.Command, args []string) {
WaitWorkflows(args, ignoreNotFound, false)
},
Expand Down
7 changes: 7 additions & 0 deletions cmd/argo/commands/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ func NewWatchCommand() *cobra.Command {
var command = &cobra.Command{
Use: "watch WORKFLOW",
Short: "watch a workflow until it completes",
Example: `# Watch a workflow:
argo watch my-wf
# Watch the latest workflow:
argo watch @latest
`,
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
cmd.HelpFunc()(cmd, args)
Expand Down

0 comments on commit 4bd33c6

Please sign in to comment.