Skip to content

Commit

Permalink
add --quiet flag for apps list (#3719)
Browse files Browse the repository at this point in the history
  • Loading branch information
fliepeltje committed Jul 9, 2024
1 parent b57e7fb commit 330f340
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/command/apps/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ the name, owner (org), status, and date/time of latest deploy for each app.

flag.Add(cmd, flag.JSONOutput())
flag.Add(cmd, flag.Org())
flag.Add(cmd, flag.Bool{
Name: "quiet",
Shorthand: "q",
Description: "Only list app names",
})

cmd.Aliases = []string{"ls"}
return cmd
}

func runList(ctx context.Context) (err error) {
client := flyutil.ClientFromContext(ctx)
silence := flag.GetBool(ctx, "quiet")
cfg := config.FromContext(ctx)
org, err := getOrg(ctx)
if err != nil {
Expand Down Expand Up @@ -68,6 +74,13 @@ func runList(ctx context.Context) (err error) {
verbose := flag.GetBool(ctx, "verbose")

rows := make([][]string, 0, len(apps))
if silence {
for _, app := range apps {
rows = append(rows, []string{app.Name})
}
_ = render.Table(out, "", rows)
return
}
for _, app := range apps {
latestDeploy := ""
if app.Deployed && app.CurrentRelease != nil {
Expand Down

0 comments on commit 330f340

Please sign in to comment.