private static void ConfigureSanityCheckCommand(IConfigurator config) => config.AddCommand <SanityCheckCommand>(NameCommandConstants.SanityCheck) .WithDescription("Sanity check the project files") .WithExample(new[] { NameCommandConstants.SanityCheck, ".", CreateEquivalentToSanityCheck(8) }) .WithExample(new[] { NameCommandConstants.SanityCheck, CreateArgumentProjectPathWithTestFolder() }) .WithExample( new[] { NameCommandConstants.SanityCheck, CreateArgumentProjectPathWithTestFolder(), CreateArgumentProjectTarget(SupportedProjectTargetType.DotNetCore), CommandConstants.ArgumentShortVerbose, });
private static void ConfigureRunCommand(IConfigurator config) => config.AddCommand <RunCommand>(NameCommandConstants.Run) .WithDescription("Update the project folder with ATC coding rules and configurations") .WithExample(new[] { ".", CreateEquivalentToRun(8) }) .WithExample(new[] { NameCommandConstants.Run, ".", CreateEquivalentToRun(4), }) .WithExample(new[] { NameCommandConstants.Run, CreateArgumentProjectPathWithDot(), CreateEquivalentToRun(1) }) .WithExample(new[] { NameCommandConstants.Run, CreateArgumentProjectPathWithTestFolder() }) .WithExample( new[] { NameCommandConstants.Run, CreateArgumentProjectPathWithTestFolder(), CreateArgumentProjectTarget(SupportedProjectTargetType.DotNetCore), ArgumentCommandConstants.LongUseTemporarySuppressions, ArgumentCommandConstants.LongOrganizationName, "MyCompany", ArgumentCommandConstants.LongRepositoryName, "MyRepo", CommandConstants.ArgumentShortVerbose, });
public static IConfigurator AddCommandWithExample <T>( this IConfigurator configurator, string name, string description, IEnumerable <string[]> examples, bool isHidden = false) where T : class, ICommand { var commandConfig = configurator .AddCommand <T>(name) .WithDescription(description); if (isHidden) { commandConfig = commandConfig.IsHidden(); } commandConfig.WithExamples(configurator, examples, isHidden); return(configurator); }
public ICommandConfigurator AddCommand(IConfigurator configurator) => configurator.AddCommand <TCommand>(_name);
private static void AddCommands(IConfigurator config) { config.AddCommand <DrillCommand>("drill").WithDescription("Send requests at a consistent rate"); config.AddCommand <HammerCommand>("hammer").WithDescription("Send increasing numbers of simultaneous requests"); config.AddCommand <NailgunCommand>("nailgun").WithDescription("Send a large number of requests all at once"); }
public static ICommandConfigurator AddCommand <TCommand>(this IConfigurator configurator) where TCommand : class, ICommand => configurator.AddCommand <TCommand>(typeof(TCommand).Name.RemoveEnd("Command", StringComparison.OrdinalIgnoreCase).ToKebab());
public static ICommandConfigurator AddCommand <TCommand>(this IConfigurator configurator) where TCommand : class, ICommand => configurator.AddCommand <TCommand>(GetCommandName(typeof(TCommand)));