Fix ps ignoring --status filter when combined with -a/--all#1
Fix ps ignoring --status filter when combined with -a/--all#1
Conversation
The --status flag was silently discarded when -a was used because the entire status-resolution block was guarded by `if not args.all`. Changed the default to None so explicit --status is always respected regardless of -a.
There was a problem hiding this comment.
Pull request overview
Fixes contree ps incorrectly ignoring an explicit --status filter whenever -a/--all was also provided, ensuring the status filter is always respected.
Changes:
- Change
--statusdefault toNoneso “unset” is distinguishable from an explicitly provided value. - Update
cmd_psstatus-selection logic to apply--statusregardless of--all, while keeping the previous default filtering behavior when neither is specified. - Add a regression test covering
--allcombined with an explicit--status.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
contree_cli/cli/ps.py |
Adjusts argument defaults and status resolution logic so --status is not dropped when --all is used. |
tests/test_ps.py |
Adds regression coverage to ensure --all --status … sends the correct query param. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes ps so an explicitly provided --status filter is respected even when combined with -a/--all, aligning CLI behavior with user intent and preventing silent filter drops.
Changes:
- Change
--statusargparse default toNoneand applyEXECUTINGas the implicit default only when--allis not used. - Update
cmd_psstatus-resolution logic so explicit--statusalways wins over--all. - Add a regression test covering
--all --status <value>request parameter behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
contree_cli/cli/ps.py |
Adjusts --status defaulting and status selection logic to honor explicit status filters with --all. |
tests/test_ps.py |
Adds regression coverage ensuring --all + explicit --status sends the status query param and prints expected output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The --status flag was silently discarded when -a was used because the entire status-resolution block was guarded by
if not args.all. Changed the default to None so explicit --status is always respected regardless of -a.