Skip to content

feat!: pretty-printed output for list commands#8

Open
onefloid wants to merge 1 commit into
mainfrom
feat/generic-list
Open

feat!: pretty-printed output for list commands#8
onefloid wants to merge 1 commit into
mainfrom
feat/generic-list

Conversation

@onefloid

Copy link
Copy Markdown
Owner

list commands (cube, dimension, process, subset, view) now print each item as a - bullet by default, instead of one plain name per line. Pass --output-raw to get the old plain output back, e.g. for scripting.

Extracted the shared "resolve database, open TM1Service, call get_all_names(), print" logic into a new generic_list() helper in tm1cli/utils/generic.py, mirroring execute_exists()'s pattern (including its connection-error handling). All five list commands now delegate to it; the per-command files no longer need TM1Service or resolve_database directly.

Also fixes MockedCubeService.get_all_names()'s mocked parameter name (cube_name -> skip_control_cubes) to match the real TM1py signature now that generic_list() calls it by keyword, and adds a get_all_names mock for MockedProcessService plus a mocked test_process_list test (process list previously had no mocked coverage at all).

BREAKING CHANGE: default stdout of tm1cli <resource> list (and its ls alias) is no longer plain one-item-per-line output; scripts relying on that must add --output-raw.

Bump version to 0.2.1 and update CHANGELOG.md / README.md.

`list` commands (cube, dimension, process, subset, view) now print
each item as a `-` bullet by default, instead of one plain name per
line. Pass --output-raw to get the old plain output back, e.g. for
scripting.

Extracted the shared "resolve database, open TM1Service, call
get_all_names(), print" logic into a new generic_list() helper in
tm1cli/utils/generic.py, mirroring execute_exists()'s pattern
(including its connection-error handling). All five list commands now
delegate to it; the per-command files no longer need TM1Service or
resolve_database directly.

Also fixes MockedCubeService.get_all_names()'s mocked parameter name
(cube_name -> skip_control_cubes) to match the real TM1py signature
now that generic_list() calls it by keyword, and adds a get_all_names
mock for MockedProcessService plus a mocked test_process_list test
(process list previously had no mocked coverage at all).

BREAKING CHANGE: default stdout of `tm1cli <resource> list` (and its
ls alias) is no longer plain one-item-per-line output; scripts
relying on that must add --output-raw.

Bump version to 0.2.1 and update CHANGELOG.md / README.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants