Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have arg_parse perform the interpolations in rustc_action arguments
Summary: I just noticed there is a built-in way in the Python `argparse` library to do this. We don't need to parse the command line as `List[str]` and then manually replace the parsed list with one that has a function applied to each argument. We already use a similar `type=key_value_arg` for flags like `--env`, where it's responsible for splitting `--env K=V` into a tuple `("K", "V")`. https://www.internalfb.com/code/fbsource/[a6d422d969cd7e6615d6992fbcc52a772ab16954]/fbcode/buck2/prelude/rust/tools/rustc_action.py?lines=79-85 https://www.internalfb.com/code/fbsource/[a6d422d969cd7e6615d6992fbcc52a772ab16954]/fbcode/buck2/prelude/rust/tools/rustc_action.py?lines=44-48 Reviewed By: zertosh Differential Revision: D58790340 fbshipit-source-id: 4f92d96d00fa60501bc34f418f54479e82937e76
- Loading branch information