feat: add --format json support to apps:list

The `apps:list` command now accepts a `--format` flag that defaults to `stdout` and can be set to `json` to emit the app names as a JSON array, matching the JSON output the `:report` subcommands already provide. When no apps exist, the JSON output is an empty array.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-07-06 11:50:56 -04:00
1 parent ce69ca76ad
commit 21c27e99cc
5 files changed
+67 -6

No files matched your search

+2 -1
View File
@@ -44,8 +44,9 @@ func main() {
err = apps.CommandExists(appName)
case "list":
args := flag.NewFlagSet("apps:list", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")
args.Parse(os.Args[2:])
err = apps.CommandList()
err = apps.CommandList(*format)
case "lock":
args := flag.NewFlagSet("apps:lock", flag.ExitOnError)
args.Parse(os.Args[2:])