/// <summary> /// Inform the user of parameters for a particular module's command. /// </summary> private void OutputParameterList(ICliModule module, ICommand command) { var defaultParameters = new[] { new CommandParameter { Name = "-log <level>", Description = "Set log level: debug, info, warning, error. (global)" }, new CommandParameter { Name = "-o <path>", Description = "Sets an output path. (global)" }, new CommandParameter { Name = "+r", Description = "Use recursive input directories. (global)" }, new CommandParameter { Name = "+zip", Description = "Indicate input files are ZIP archives. All files inside will be processed." } }; _console.WriteLine($"Available parameters for command \"{module.Name} {command.Name}\":"); _console.WriteLine(); foreach (var parameter in defaultParameters.Concat(command.Parameters)) { _console.WriteLine($"{parameter.Name.PadRight(20)}{parameter.Description}"); } _console.WriteLine(); _console.WriteLine("Executing this command with any parameters will perform the action."); }
public static ICliBuilder AddModule(this ICliBuilder cliBuilder, ICliModule cliModule) { Ensure.NotNull(cliModule, nameof(cliModule)); cliModule.Configure(cliBuilder); return(cliBuilder); }
/// <summary> /// Inform the user of commands available to a particular module. /// </summary> private void OutputCommandList(ICliModule module) { _console.WriteLine($"Available commands for module \"{module.Name}\":"); _console.WriteLine(); foreach (var command in module.Commands.OrderBy(c => c.Name)) { _console.WriteLine($"{command.Name.PadRight(20)}{command.Description}"); } _console.WriteLine(); _console.WriteLine("To learn more about a command:"); _console.WriteLine($"{AppName} {module.Name.ToLower()} <command>"); }
/// <summary> /// Creates a new <see cref="CliModuleMethod"/> with the /// <paramref name="metadata"/>, <paramref name="manager"/>, and <paramref name="owner"/> provided. /// </summary> /// <param name="metadata">The <see cref="ICliMetadataMethodDefinitionTableRow"/> from which the /// <see cref="CliModuleMethod"/> is derived.</param> /// <param name="assembly">The <see cref="_ICliAssembly"/> which contains the <see cref="CliModuleMethod"/>.</param> /// <param name="owner">The <see cref="ICliModule"/> from which the /// <see cref="CliModuleMethod"/> is derived.</param> internal CliModuleMethod(ICliMetadataMethodDefinitionTableRow metadata, _ICliAssembly assembly, ICliModule owner, IGeneralGenericSignatureMemberUniqueIdentifier uniqueIdentifier) : base(metadata, assembly, owner, uniqueIdentifier) { }