Improve usage statement conventions for positional arguments - #487
Improve usage statement conventions for positional arguments#487brentyi wants to merge 1 commit into
Conversation
Two changes: - When the usage line is too long and gets abbreviated to [OPTIONS], positional metavars are now kept visible after the [OPTIONS] token instead of being dropped entirely. - Add tyro.conf.PositionalMetavarFromFieldName, which labels positional arguments with their (uppercased) field name instead of a type-based metavar, following argparse conventions. Explicit metavars from tyro.conf.arg(metavar=...) still take precedence.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #487 +/- ##
=======================================
Coverage 99.79% 99.80%
=======================================
Files 53 53
Lines 4495 4507 +12
=======================================
+ Hits 4486 4498 +12
Misses 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Status: all pytest and pyright jobs are green. The ruff, mypy, and ty failures are pre-existing on main: CI runs unpinned latest linters, and all flagged locations are in files this PR does not touch (verified locally that unmodified main fails ruff 0.16.0 with the same 18 PLR0917 errors; mypy and ty failures are similar version drift in Generated by Claude Code |
Keep positional metavars visible when the usage line is abbreviated to [OPTIONS], and add
tyro.conf.PositionalMetavarFromFieldNamefor labeling positionals by field name, addressing #484.