Skip to content

Fix ps ignoring --status filter when combined with -a/--all#1

Merged
mosquito merged 2 commits intomasterfrom
cli-ps-all-status-fix
Apr 30, 2026
Merged

Fix ps ignoring --status filter when combined with -a/--all#1
mosquito merged 2 commits intomasterfrom
cli-ps-all-status-fix

Conversation

@mosquito
Copy link
Copy Markdown
Collaborator

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.

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.
@mosquito mosquito requested review from Copilot and insomnes and removed request for Copilot April 30, 2026 10:24
@mosquito mosquito requested review from Copilot and removed request for insomnes April 30, 2026 10:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --status default to None so “unset” is distinguishable from an explicitly provided value.
  • Update cmd_ps status-selection logic to apply --status regardless of --all, while keeping the previous default filtering behavior when neither is specified.
  • Add a regression test covering --all combined 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.

Comment thread contree_cli/cli/ps.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --status argparse default to None and apply EXECUTING as the implicit default only when --all is not used.
  • Update cmd_ps status-resolution logic so explicit --status always 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.

Comment thread contree_cli/cli/ps.py
@mosquito mosquito merged commit b025923 into master Apr 30, 2026
24 checks passed
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