This patch adds initial support for refactoring options. One can now use optional and required std::string options.
The options are implemented in the following manner:
- A base interface RefactoringOption declares methods that describe the option's name, description and whether or not it's required. It also declares a method that takes in a RefactoringOptionConsumer that will visit the option and its typed value.
- A visitor interface RefactoringOptionConsumer declares the handle methods that provide an overload for each valid option type (std::string, etc).
- Classes OptionalRequiredOption and RequiredRefactoringOption partially implement the RefactoringOption interface, store the value and provide a getter for the value. The individual options then just have to implement getName and getDescription.
- The RefactoringOptionsRequirement is a base requirement class the declares a method that can returns all of the options used in a single requirement.
- The OptionRequirement class is a helper class that implements a refactoring action rule requirement for a particular option.
clang-refactor now creates command-line arguments for each unique option used by all rules in an action.
This patch also adds a NewNameOption for the local-rename refactoring action to ensure that options work.
Please document the behavior here. What options are visited? How is the consumer used?