Skip to content

Commit

Permalink
Print multiple workflows in one command (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki authored and sarabala1979 committed Oct 21, 2019
1 parent defbc29 commit 08f49d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
18 changes: 10 additions & 8 deletions cmd/argo/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ func NewGetCommand() *cobra.Command {
os.Exit(1)
}
wfClient := InitWorkflowClient()
wf, err := wfClient.Get(args[0], metav1.GetOptions{})
if err != nil {
log.Fatal(err)
}
err = util.DecompressWorkflow(wf)
if err != nil {
log.Fatal(err)
for _, arg := range args {
wf, err := wfClient.Get(arg, metav1.GetOptions{})
if err != nil {
log.Fatal(err)
}
err = util.DecompressWorkflow(wf)
if err != nil {
log.Fatal(err)
}
printWorkflow(wf, getArgs.output, getArgs.status)
}
printWorkflow(wf, getArgs.output, getArgs.status)
},
}

Expand Down
10 changes: 6 additions & 4 deletions cmd/argo/commands/template/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ func NewGetCommand() *cobra.Command {
os.Exit(1)
}
wftmplClient := InitWorkflowTemplateClient()
wftmpl, err := wftmplClient.Get(args[0], metav1.GetOptions{})
if err != nil {
log.Fatal(err)
for _, arg := range args {
wftmpl, err := wftmplClient.Get(arg, metav1.GetOptions{})
if err != nil {
log.Fatal(err)
}
printWorkflowTemplate(wftmpl, output)
}
printWorkflowTemplate(wftmpl, output)
},
}

Expand Down

0 comments on commit 08f49d0

Please sign in to comment.