Repository navigation
fix(cli): make --last agree across log, tune and policy-history - #737
Open
dchaudhari7177 wants to merge 2 commits into
Open
dchaudhari7177 wants to merge 2 commits into
dchaudhari7177 wants to merge 2 commits into
Conversation
log, tune and policy-history took a negative --last and quietly showed nothing, and tune had no -n short form. Add min=0 to all three, so a negative value is a usage error (exit 2) while 0 still means zero rows (DobermanCore#430), and give tune's --last the -n alias. Closes DobermanCore#716
This branch has not been deployed
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.
Closes #716 (and its PostHog twin #729).
What changes
--lastonlog,tuneandpolicy-historygetsmin=0. A negative value is now Typer's usage error (exit 2) instead of an empty listing.0stays allowed and still means zero rows (storage:--last 0returns every row instead of none #430).tune's--lastgets the-nshort form the other three commands already have.docs/CLI.md:tune's options column now reads--last/-n;log,tune,policy-history|2row ("--lastis negative;0is allowed and means zero rows");logandpolicy-historyleave the "Commands not listed" sentence, since they now have an exit-2 case.tuiis unchanged: it keepsmin=1, since an empty TUI isn't useful.Tests
tests/unit/test_cli_last_option.py:--last -1and-n -1exit 2 on each of the three commands (6 cases);--last 0still exits 0 on each;tune -n 5runs, and its output is identical totune --last 5.On
main: 7 failed, 3 passed. On this branch the new file,test_cli_log_jsonl.py(including its #430--last 0case),test_storage_last_zero.pyandtest_cli_help.pyall pass. ruff check and format are clean.AI assistance: I used an AI assistant while writing this change and the tests. I reviewed the diff and ran the tests above myself.