Warn when deprecated options are passed to commands and improve their docs.
Review Request #14623 — Created Sept. 25, 2025 and updated
We currently allow for
rbtoptions to be marked as deprecated, and we'll
display deprecation info in the documentation and help text for the option.
But we weren’t emitting any warnings when users actually passed them on
the command line. This change allowsrbtto emit a deprecation warning
when a deprecated option is used.This change also allows setting a replacement option and the version in
which the option will be removed. Our sphinx documentation building
functions and help text building logic have been updated to include these.I decided to move our RBTools-specific option attributes out of
Option.attrsand made them direct attributes on theOptionclass
instead. This keeps a clearer separation from theargparsearguments
and lets us keep this information around after the Option is added to
the parser (previously we would strip all of our custom attributes
before adding an option to the parser). We also get easy typing on
these attributes now.We also recently marked
rbt login's--enable-loggingas deprecated, and
this change defines its replacement (--debug) and removal version (6.0).
- Tested
rbt login -lsaw the deprecation warning - Tested
rbt loginwith options other than-l, saw no warnings - Ran unit tests.
- Built docs and looked at options that have one or more of the custom
RBTools attributes (config key, extended help, added in and the various
deprecation related attributes).
| Summary | ID |
|---|---|
| 71e1b5c3cc65d809f7da5e8de88afcf8562c5b48 |
| Description | From | Last Updated |
|---|---|---|
|
Can we add a blank line above this? |
|
|
|
This should come from collections.abc instead of typing |
|
|
|
Can we use Mapping[...] instead of dict[...] here? |
|
|
|
This might be from a different change, but this should be 5.4, no? |
|
|
|
This should be docutils.nodes.paragraph. |
|
|
|
The ] should be on the next line. |
|
|
|
) should be on the next line for a multi-line string. |
|
|
|
Do we have a local logger we can use? |
|
|
|
Will this work? all_options += item.option_list Same in other code paths doing this. |
|
|
|
This can be combined to one statement now. |
|
|
|
Can you make this a multi-line string with the strings on their own lines? |
|
- Commits:
-
Summary ID f5af1a0f4b96e06beaec8cc8aface92aa9acb8b1 d8611fe93455105d6333a6fa533d85872ba6af5f
Checks run (2 succeeded)
- Commits:
-
Summary ID d8611fe93455105d6333a6fa533d85872ba6af5f 15272d8ea34feef0a76480ffb72f551ef6c52af2
Checks run (2 succeeded)
- Commits:
-
Summary ID 15272d8ea34feef0a76480ffb72f551ef6c52af2 ba2deda4598c0829cb6c26618cdfa952949257d2