One design goal for Revolver was to be a platform for custom tool development and allow users to create their own commands.
Revolver commands must implement the
Revolver.Core.Commands.ICommand, Revolver.Core interface. As a convenience commands may subclass
Revolver.Core.Commands.BaseCommand, Revolver.Core which implements the interface and handles initialisation.
Arguments passed to the command through the command line are automatically mapped to properties of the command class. Attributes are used to facilitate this mapping and control how it’s performed.
The following attributes are supported:
- Provides a description of the command which is used in the help system.
- For boolean properties. This argument is either present or not.
- For `IList
` properties. Collects all unmatched arguments from the argument list.
- For arguments passed by name.
- Indicates token substitution should not be performed for the property.
- For arguments passed in order.
- Indicates the argument is optional. Only used as an indicator in the help system, not enforced by the parser.
Here’s a quick example of a custom command that uses automatic argument mapping.
public class MyCommand : BaseCommand
The best reference available for implementing commands in Revolver would be the Revolver source itself. Have a look over the commands at https://github.com/codeflood/revolver/tree/master/Revolver.Core/Commands