Skip to content

Commit fc751a6

Browse files
committed
Document ls --json breaking change and fix help example
- CHANGES: Add breaking change notice for --json output format (changed from array to {"workspaces": [...], "global_workspace_dirs": [...]}) - CHANGES: Add migration examples for jq users - ls.py: Fix help text jq example from '.[] | .name' to '.workspaces[].name'
1 parent ffd200e commit fc751a6

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

CHANGES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ New `tmuxp search` command for finding workspace files:
5757

5858
#### Enhanced ls Command (#1006)
5959

60+
**Breaking change**: `--json` output format changed from array to object.
61+
62+
- Old: `tmuxp ls --json``[{...}, {...}]`
63+
- New: `tmuxp ls --json``{"workspaces": [...], "global_workspace_dirs": [...]}`
64+
65+
Migration:
66+
67+
- Old: `tmuxp ls --json | jq '.[].name'`
68+
- New: `tmuxp ls --json | jq '.workspaces[].name'`
69+
- Alt: Use `--ndjson` for streaming individual workspace objects
70+
6071
New output options for `tmuxp ls`:
6172

6273
- `--tree`: Display workspaces grouped by directory

src/tmuxp/cli/ls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"tmuxp ls --json",
6363
"tmuxp ls --json --full",
6464
"tmuxp ls --ndjson",
65-
"tmuxp ls --json | jq '.[] | .name'",
65+
"tmuxp ls --json | jq '.workspaces[].name'",
6666
],
6767
),
6868
),

0 commit comments

Comments
 (0)