/// <summary> /// Register sub command for the command /// </summary> /// <param name="name">Command name</param> /// <param name="description">Command description for help.</param> /// <param name="configureCommand">Command configuration callback</param> /// <typeparam name="TCommandArguments">Type of callback arguments type.</typeparam> /// <returns>Self instance</returns> public CommandConfigurator <TArguments> RegisterCommand <TCommandArguments>(string name, string description, Action <CommandConfigurator <TCommandArguments> > configureCommand) { _commandConfigurator.RegisterCommand( name, description, configurator => { var commandConfigurator = new CommandConfigurator <TCommandArguments>(configurator); configureCommand.Invoke( commandConfigurator ); commandConfigurator.RegisterArguments(); }); return(this); }
public CommandRegisterer(CommandConfigurator commandConfigurator) { _commandConfigurator = commandConfigurator; }
/// <summary> /// Creates new instance of CommandConfigurator<TArguments> /// </summary> /// <param name="commandConfigurator">Command configurator used internally to configure command.</param> public CommandConfigurator(CommandConfigurator commandConfigurator) { _commandConfigurator = commandConfigurator; _commandRegisterer = new CommandRegisterer(commandConfigurator); }