Help-screen grouping + better --slice diagnostics (work-ixhv)#14
Merged
Conversation
949f2a6 to
d87de40
Compare
e46039d to
3a15e63
Compare
7e9926a to
8409d8e
Compare
`flight search --help` (and calendar/detail) now show flags grouped into
named panels: Itinerary / Filtering / Output / Backend & providers.
Same group names across commands so the user gets a consistent mental
map. Zero behavior change — pure rendering.
--slice parser now surfaces the specific failure mode instead of the
generic "should be ORIGIN-DEST:DATE[:r=...:e=...]":
- missing date → "missing date — expected ORIGIN-DEST:DATE..."
- malformed origin-dest → "missing '-' between origin and destination"
- empty origin/dest → "must both be non-empty"
- invalid date → "invalid date 'YYYY-MM-DD'"
- unknown key prefix → "unknown key prefix in 'r-LH+'; valid keys are
r=ROUTING and e=EXTENSION (note the '=')"
The unknown-key-prefix branch closes a silent-failure path: typing
`r-LH+` instead of `r=LH+` previously got dropped by the lookahead split
without warning, so the user got a search that ignored their routing.
10 new tests in tests/test_slice_diagnostics.py pin each error path.
Stacked on top of work-4uls (#13).
8e1c55e to
57f471d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #13 (work-4uls surface hygiene). Merge order: #12 → #13 → this. Retarget this PR's base to `main` once #13 merges, before #13's branch gets deleted (per gh_stacked_pr_base_branch_deletion).
Summary
Two changes that compound nicely on the surface-hygiene work in #13:
Grouped help panels. `flight search --help` (plus `calendar` and `detail`) now renders flags inside named Rich panels — Itinerary / Filtering / Output / Backend & providers — instead of one undifferentiated dump. Same group names across commands so the user gets a consistent mental map for where each flag lives. Zero behavior change; pure rendering via Typer's `rich_help_panel` kwarg.
--slice parser diagnostics. The original `BadParameter` message was fine for missing-date but useless for the most common typo (`r-LH+` instead of `r=LH+` — silently ignored by the lookahead split). Each failure mode now surfaces a specific message:
The unknown-key-prefix branch closes a real silent-failure path: `r-LH+` previously fell off the lookahead split's allow-list and the routing was just gone with no warning.
Test plan