Skip to content

Commit

Permalink
docs: Add an example field to argo list command. Fixes #11898 (#12076)
Browse files Browse the repository at this point in the history
Signed-off-by: Krunal Parmar <[email protected]>
(cherry picked from commit ce60013)
  • Loading branch information
Krunal2017 authored and agilgur5 committed May 4, 2024
1 parent 3e1b7a0 commit cd3d2f4
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cmd/argo/commands/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,34 @@ func NewListCommand() *cobra.Command {
command := &cobra.Command{
Use: "list",
Short: "list workflows",
Example: `# List all workflows:
argo list
# List all workflows from all namespaces:
argo list -A
# List all running workflows:
argo list --running
# List all completed workflows:
argo list --completed
# List workflows created within the last 10m:
argo list --since 10m
# List workflows that finished more than 2h ago:
argo list --older 2h
# List workflows with more information (such as parameters):
argo list -o wide
# List workflows in YAML format:
argo list -o yaml
# List workflows that have both labels:
argo list -l label1=value1,label2=value2
`,

Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient(cmd.Context())
serviceClient := apiClient.NewWorkflowServiceClient()
Expand Down
32 changes: 32 additions & 0 deletions docs/cli/argo_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@ list workflows
argo list [flags]
```

### Examples

```
# List all workflows:
argo list
# List all workflows from all namespaces:
argo list -A
# List all running workflows:
argo list --running
# List all completed workflows:
argo list --completed
# List workflows created within the last 10m:
argo list --since 10m
# List workflows that finished more than 2h ago:
argo list --older 2h
# List workflows with more information (such as parameters):
argo list -o wide
# List workflows in YAML format:
argo list -o yaml
# List workflows that have both labels:
argo list -l label1=value1,label2=value2
```

### Options

```
Expand Down

0 comments on commit cd3d2f4

Please sign in to comment.