Example #1
0
 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,
 });
Example #2
0
 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,
 });
Example #3
0
        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);
Example #5
0
 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());
Example #7
0
 public static ICommandConfigurator AddCommand <TCommand>(this IConfigurator configurator)
     where TCommand : class, ICommand =>
 configurator.AddCommand <TCommand>(GetCommandName(typeof(TCommand)));