Skip to content

Commit

Permalink
feat: Add an example field to argo list command. Fixes argoproj#11898
Browse files Browse the repository at this point in the history
Signed-off-by: Krunal Parmar <parmarkrunal2007@gmail.com>
  • Loading branch information
Krunal2017 committed Oct 26, 2023
1 parent 2abc16f commit 52f3efb
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
# Show workflows from all namespaces:
argo list -A
# List all completed worflows:
argo list --completed
# List completed workflows finished before 2h:
argo list --older 2h
# List worflows with more information (such as parameters):
argo list -o wide
# List worflows in yaml format:
argo list -o yaml
# List all running worflows:
argo list --running
# List worflows with specific labels:
argo list -l label1=value1,label2=value2
# List workflows created within last 10m:
argo list --since 10m
`,

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
# Show workflows from all namespaces:
argo list -A
# List all completed worflows:
argo list --completed
# List completed workflows finished before 2h:
argo list --older 2h
# List worflows with more information (such as parameters):
argo list -o wide
# List worflows in yaml format:
argo list -o yaml
# List all running worflows:
argo list --running
# List worflows with specific labels:
argo list -l label1=value1,label2=value2
# List workflows created within last 10m:
argo list --since 10m
```

### Options

```
Expand Down

0 comments on commit 52f3efb

Please sign in to comment.