Skip to content

fix(ndcli): add tree view for list containers#304

Open
theinig wants to merge 2 commits into
IONOS-Core:masterfrom
theinig:master
Open

fix(ndcli): add tree view for list containers#304
theinig wants to merge 2 commits into
IONOS-Core:masterfrom
theinig:master

Conversation

@theinig

@theinig theinig commented Jun 23, 2026

Copy link
Copy Markdown

Add a Unicode tree rendering mode to list containers with:

  • -T/--tree to switch output to a visual tree
  • -p/--pattern to filter tree output by regex
  • -c/--case-sensitive for exact matching
  • --no-color to disable ANSI highlighting

Keep the existing flat output path unchanged when tree mode is not requested. When filtering is enabled, retain matching nodes, their ancestors, and their child subtrees so the rendered tree preserves context.

Add a Unicode tree rendering mode to `list containers` with:
- `-T/--tree` to switch output to a visual tree
- `-p/--pattern` to filter tree output by regex
- `-c/--case-sensitive` for exact matching
- `--no-color` to disable ANSI highlighting

Keep the existing flat output path unchanged when tree mode is not requested.
When filtering is enabled, retain matching nodes, their ancestors, and their child subtrees so the rendered tree preserves context.

Co-authored-by: GitHub Copilot (GPT-5.4 mini) <github-copilot@openai.com>
Signed-off-by: Torsten Heinig <torsten.heinig@ionos.com>
@miesi-ionos

Copy link
Copy Markdown
Collaborator

Please review CONTRIBUTING.md

  • there are no testcases in dim-testsuite/t in the PR. Please instruct your AI create testcases and validate that the code works along the testcases.

Add dim-testsuite/t/container-list-tree.t, the integration test
required by CONTRIBUTING.md for the feature shipped in f9721e5
(fix(ndcli): add tree view for list containers).

The test covers all four new flags of `ndcli list containers`:

- --tree / -T: Unicode box-drawing rendering (└──, ├──, │   )
  verified for single-container (└── only) and multi-container
  layouts (├── + │ prefix for non-last; └── + spaces for last).
- --pattern / -p: regex filter retains matching nodes with all their
  children and their ancestor path; unmatched subtrees are pruned
  (10.x block is dropped when pattern is "11").
- --case-sensitive / -c: confirmed that lowercase "container" does
  not match "(Container)" and that WARNING is emitted with no output.
- --no-color: flag accepted without error; ANSI codes are already
  suppressed for non-tty stdout, output is identical to -T alone.

Also removes a stray trailing space on a blank line in
ndcli/dimcli/__init__.py left over from the feature commit.

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Torsten Heinig <torsten.heinig@ionos.com>
@theinig

theinig commented Jun 30, 2026

Copy link
Copy Markdown
Author

dim-testsuite/t/container-list-tree.t added to the PR.

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