forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify OptionParser fields. (pantsbuild#21689)
Previously the OptionParser held explicit references to the `passthrough_args` and `args_tracker` of its ArgsReader. However this denormalization can lead to inconsistency if we were to want to replace the ArgsReader during options bootstrapping. Now that we have the `as_any()` mechanism we can downcast the ArgsReader and get those fields out of it as needed, so now there is only one reference into the args reader and its internals. This PR also adds a field to the `Args` struct to store the original strings the `Args` was parsed from. Both of these are preliminaries for an upcoming change that ports the CLI Alias mechanism to Rust.
- Loading branch information
Showing
4 changed files
with
40 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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