Refactor Context + Make search path dependent on sudoers file #991
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.
Dependent on #897
Closes #989
Closes #986
There is some duplication in
context.rs
, but that is essentially the duplication that was already there in theFrom<>
impl's that were previously there (whose only job was converting the nicely seperate CLI objects into a intermediate object that was then converted to the "Context" object.This PR doesn't get rid of the Context object but does make it shorter-lived: it only exists in the pipeline now where we can maybe chip away at it more. Also, it doesn't really fix the issue that Context is a "one size fits all" object that doesn't really get fully used in every circumstance.
It probably is blasphemous to say this but this is one of the areas where I feel having structural inheritance can be a nice thing. :-)