Preparations for the 1.0 release

* Less cluttered solution layout.
* Move examples to a repository of its own.
* Move Roslyn analyzer to a repository of its own.
* Enable central package management.
* Clean up csproj files.
* Add README file to NuGet packages.
This commit is contained in:
Patrik Svensson
2024-08-05 20:41:45 +02:00
committed by Patrik Svensson
parent bb72b44d60
commit 42fd801876
677 changed files with 272 additions and 6214 deletions

107
src/Tests/.editorconfig Normal file
View File

@ -0,0 +1,107 @@
root = false
[*.cs]
# Default severity for analyzer diagnostics with category 'StyleCop.CSharp.DocumentationRules'
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none
# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = warning
# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none
# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = none
# SA1201: Elements should appear in the correct order
dotnet_diagnostic.SA1201.severity = none
# SA1202: Public members should come before private members
dotnet_diagnostic.SA1202.severity = none
# SA1309: Field names should not begin with underscore
dotnet_diagnostic.SA1309.severity = none
# SA1404: Code analysis suppressions should have justification
dotnet_diagnostic.SA1404.severity = none
# SA1516: Elements should be separated by a blank line
dotnet_diagnostic.SA1516.severity = none
# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none
# CSA1204: Static members should appear before non-static members
dotnet_diagnostic.SA1204.severity = none
# IDE0052: Remove unread private members
dotnet_diagnostic.IDE0052.severity = warning
# IDE0063: Use simple 'using' statement
csharp_prefer_simple_using_statement = false:suggestion
# IDE0018: Variable declaration can be inlined
dotnet_diagnostic.IDE0018.severity = warning
# SA1625: Element documenation should not be copied and pasted
dotnet_diagnostic.SA1625.severity = none
# IDE0005: Using directive is unnecessary
dotnet_diagnostic.IDE0005.severity = warning
# SA1117: Parameters should be on same line or separate lines
dotnet_diagnostic.SA1117.severity = none
# SA1404: Code analysis suppression should have justification
dotnet_diagnostic.SA1404.severity = none
# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none
# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = none
# SA1649: File name should match first type name
dotnet_diagnostic.SA1649.severity = none
# SA1402: File may only contain a single type
dotnet_diagnostic.SA1402.severity = none
# CA1814: Prefer jagged arrays over multidimensional
dotnet_diagnostic.CA1814.severity = none
# RCS1194: Implement exception constructors.
dotnet_diagnostic.RCS1194.severity = none
# CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = none
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
dotnet_diagnostic.CA1826.severity = none
# RCS1079: Throwing of new NotImplementedException.
dotnet_diagnostic.RCS1079.severity = warning
# RCS1057: Add empty line between declarations.
dotnet_diagnostic.RCS1057.severity = none
# RCS1057: Validate arguments correctly
dotnet_diagnostic.RCS1227.severity = none
# IDE0004: Remove Unnecessary Cast
dotnet_diagnostic.IDE0004.severity = warning
# CA1810: Initialize reference type static fields inline
dotnet_diagnostic.CA1810.severity = none
# IDE0044: Add readonly modifier
dotnet_diagnostic.IDE0044.severity = warning
# RCS1047: Non-asynchronous method name should not end with 'Async'.
dotnet_diagnostic.RCS1047.severity = none
# RCS1090: Call 'ConfigureAwait(false)'.
dotnet_diagnostic.RCS1090.severity = warning
# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none

View File

@ -0,0 +1,11 @@
<Project>
<PropertyGroup Label="Settings">
<LangVersion>12</LangVersion>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)/../stylecop.json" Link="Properties/stylecop.json"/>
</ItemGroup>
</Project>

View File

@ -0,0 +1,18 @@
namespace Spectre.Console.Tests;
public static class Constants
{
public static string[] VersionCommand { get; } =
new[]
{
CliConstants.Commands.Branch,
CliConstants.Commands.Version,
};
public static string[] XmlDocCommand { get; } =
new[]
{
CliConstants.Commands.Branch,
CliConstants.Commands.XmlDoc,
};
}

View File

@ -0,0 +1,8 @@
using SystemConsole = System.Console;
namespace Spectre.Console.Tests.Data;
public abstract class AnimalCommand<TSettings> : Command<TSettings>
where TSettings : CommandSettings
{
}

View File

@ -0,0 +1,28 @@
namespace Spectre.Console.Tests.Data;
public sealed class AsynchronousCommand : AsyncCommand<AsynchronousCommandSettings>
{
private readonly IAnsiConsole _console;
public AsynchronousCommand(IAnsiConsole console)
{
_console = console;
}
public async override Task<int> ExecuteAsync(CommandContext context, AsynchronousCommandSettings settings)
{
// Simulate a long running asynchronous task
await Task.Delay(200);
if (settings.ThrowException)
{
throw new Exception($"Throwing exception asynchronously");
}
else
{
_console.WriteLine($"Finished executing asynchronously");
}
return 0;
}
}

View File

@ -0,0 +1,9 @@
namespace Spectre.Console.Tests.Data;
public class CatCommand : AnimalCommand<CatSettings>
{
public override int Execute(CommandContext context, CatSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,30 @@
namespace Spectre.Console.Tests.Data;
[Description("The dog command.")]
public class DogCommand : AnimalCommand<DogSettings>
{
public override ValidationResult Validate(CommandContext context, DogSettings settings)
{
if (context is null)
{
throw new System.ArgumentNullException(nameof(context));
}
if (settings is null)
{
throw new System.ArgumentNullException(nameof(settings));
}
if (settings.Age > 100 && !context.Remaining.Raw.Contains("zombie"))
{
return ValidationResult.Error("Dog is too old...");
}
return base.Validate(context, settings);
}
public override int Execute(CommandContext context, DogSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,34 @@
namespace Spectre.Console.Tests.Data;
public sealed class DumpRemainingCommand : Command<EmptyCommandSettings>
{
private readonly IAnsiConsole _console;
public DumpRemainingCommand(IAnsiConsole console)
{
_console = console;
}
public override int Execute(CommandContext context, EmptyCommandSettings settings)
{
if (context.Remaining.Raw.Count > 0)
{
_console.WriteLine("# Raw");
foreach (var item in context.Remaining.Raw)
{
_console.WriteLine(item);
}
}
if (context.Remaining.Parsed.Count > 0)
{
_console.WriteLine("# Parsed");
foreach (var item in context.Remaining.Parsed)
{
_console.WriteLine(string.Format("{0}={1}", item.Key, string.Join(",", item.Select(x => x))));
}
}
return 0;
}
}

View File

@ -0,0 +1,9 @@
namespace Spectre.Console.Tests.Data;
public sealed class EmptyCommand : Command<EmptyCommandSettings>
{
public override int Execute(CommandContext context, EmptyCommandSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,10 @@
namespace Spectre.Console.Tests.Data;
public sealed class GenericCommand<TSettings> : Command<TSettings>
where TSettings : CommandSettings
{
public override int Execute(CommandContext context, TSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,10 @@
namespace Spectre.Console.Tests.Data;
[Description("The giraffe command.")]
public sealed class GiraffeCommand : Command<GiraffeSettings>
{
public override int Execute(CommandContext context, GiraffeSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,17 @@
using Spectre.Console;
public class GreeterCommand : Command<OptionalArgumentWithDefaultValueSettings>
{
private readonly IAnsiConsole _console;
public GreeterCommand(IAnsiConsole console)
{
_console = console;
}
public override int Execute(CommandContext context, OptionalArgumentWithDefaultValueSettings settings)
{
_console.WriteLine(settings.Greeting);
return 0;
}
}

View File

@ -0,0 +1,9 @@
namespace Spectre.Console.Tests.Data;
public sealed class HiddenOptionsCommand : Command<HiddenOptionSettings>
{
public override int Execute(CommandContext context, HiddenOptionSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,10 @@
namespace Spectre.Console.Tests.Data;
[Description("The horse command.")]
public class HorseCommand : AnimalCommand<HorseSettings>
{
public override int Execute(CommandContext context, HorseSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,9 @@
namespace Spectre.Console.Tests.Data;
public sealed class InvalidCommand : Command<InvalidSettings>
{
public override int Execute(CommandContext context, InvalidSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,10 @@
namespace Spectre.Console.Tests.Data;
[Description("The lion command.")]
public class LionCommand : AnimalCommand<LionSettings>
{
public override int Execute(CommandContext context, LionSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,12 @@
namespace Spectre.Console.Tests.Data;
public sealed class NoDescriptionCommand : Command<EmptyCommandSettings>
{
[CommandOption("-f|--foo <VALUE>")]
public int Foo { get; set; }
public override int Execute(CommandContext context, EmptyCommandSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,9 @@
namespace Spectre.Console.Tests.Data;
public class OptionVectorCommand : Command<OptionVectorSettings>
{
public override int Execute(CommandContext context, OptionVectorSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,9 @@
namespace Spectre.Console.Tests.Data;
public sealed class ThrowingCommand : Command<ThrowingCommandSettings>
{
public override int Execute(CommandContext context, ThrowingCommandSettings settings)
{
throw new InvalidOperationException("W00t?");
}
}

View File

@ -0,0 +1,10 @@
namespace Spectre.Console.Tests.Data;
[Description("The turtle command.")]
public class TurtleCommand : AnimalCommand<TurtleSettings>
{
public override int Execute(CommandContext context, TurtleSettings settings)
{
return 0;
}
}

View File

@ -0,0 +1,18 @@
namespace Spectre.Console.Tests.Data;
public sealed class VersionCommand : Command<VersionSettings>
{
private readonly IAnsiConsole _console;
public VersionCommand(IAnsiConsole console)
{
_console = console;
}
public override int Execute(CommandContext context, VersionSettings settings)
{
_console.WriteLine($"VersionCommand ran, Version: {settings.Version ?? string.Empty}");
return 0;
}
}

View File

@ -0,0 +1,14 @@
namespace Spectre.Console.Tests.Data;
public sealed class CatAgilityConverter : TypeConverter
{
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string stringValue)
{
return stringValue.Length;
}
return base.ConvertFrom(context, culture, value);
}
}

View File

@ -0,0 +1,14 @@
namespace Spectre.Console.Tests.Data;
public sealed class StringToIntegerConverter : TypeConverter
{
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string stringValue)
{
return int.Parse(stringValue, CultureInfo.InvariantCulture);
}
return base.ConvertFrom(context, culture, value);
}
}

View File

@ -0,0 +1,34 @@
using Spectre.Console.Rendering;
namespace Spectre.Console.Cli.Tests.Data.Help;
internal class CustomHelpProvider : HelpProvider
{
private readonly string version;
public CustomHelpProvider(ICommandAppSettings settings, string version)
: base(settings)
{
this.version = version;
}
public override IEnumerable<IRenderable> GetHeader(ICommandModel model, ICommandInfo command)
{
return new IRenderable[]
{
new Text("--------------------------------------"), Text.NewLine,
new Text("--- CUSTOM HELP PROVIDER ---"), Text.NewLine,
new Text("--------------------------------------"), Text.NewLine,
Text.NewLine,
};
}
public override IEnumerable<IRenderable> GetFooter(ICommandModel model, ICommandInfo command)
{
return new IRenderable[]
{
Text.NewLine,
new Text($"Version {version}"),
};
}
}

View File

@ -0,0 +1,21 @@
using Spectre.Console.Rendering;
namespace Spectre.Console.Cli.Tests.Data.Help;
internal class RedirectHelpProvider : IHelpProvider
{
public virtual IEnumerable<IRenderable> Write(ICommandModel model)
{
return Write(model, null);
}
#nullable enable
public virtual IEnumerable<IRenderable> Write(ICommandModel model, ICommandInfo? command)
#nullable disable
{
return new[]
{
new Text("Help has moved online. Please see: http://www.example.com"),
Text.NewLine,
};
}
}

View File

@ -0,0 +1,11 @@
namespace Spectre.Console.Cli.Tests.Data.Help;
internal class RenderMarkupHelpProvider : HelpProvider
{
protected override bool RenderMarkupInline { get; } = true;
public RenderMarkupHelpProvider(ICommandAppSettings settings)
: base(settings)
{
}
}

View File

@ -0,0 +1,14 @@
namespace Spectre.Console.Tests.Data;
public abstract class AnimalSettings : CommandSettings
{
[CommandOption("-a|--alive|--not-dead")]
[Description("Indicates whether or not the animal is alive.")]
public bool IsAlive { get; set; }
[CommandArgument(1, "[LEGS]")]
[Description("The number of legs.")]
[EvenNumberValidator("Animals must have an even number of legs.")]
[PositiveNumberValidator("Number of legs must be greater than 0.")]
public int Legs { get; set; }
}

View File

@ -0,0 +1,19 @@
namespace Spectre.Console.Tests.Data;
public sealed class ArgumentOrderSettings : CommandSettings
{
[CommandArgument(0, "[QUX]")]
public int Qux { get; set; }
[CommandArgument(3, "<CORGI>")]
public int Corgi { get; set; }
[CommandArgument(1, "<BAR>")]
public int Bar { get; set; }
[CommandArgument(2, "<BAZ>")]
public int Baz { get; set; }
[CommandArgument(0, "<FOO>")]
public int Foo { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace Spectre.Console.Tests.Data;
public class ArgumentVectorSettings : CommandSettings
{
[CommandArgument(0, "<Foos>")]
public string[] Foo { get; set; }
}

View File

@ -0,0 +1,8 @@
namespace Spectre.Console.Tests.Data;
public sealed class AsynchronousCommandSettings : CommandSettings
{
[CommandOption("--ThrowException")]
[DefaultValue(false)]
public bool ThrowException { get; set; }
}

View File

@ -0,0 +1,8 @@
namespace Spectre.Console.Tests.Data;
public class BarCommandSettings : FooCommandSettings
{
[CommandArgument(0, "<CORGI>")]
[Description("The corgi value.")]
public string Corgi { get; set; }
}

View File

@ -0,0 +1,11 @@
namespace Spectre.Console.Tests.Data;
public class CatSettings : MammalSettings
{
[CommandOption("--agility <VALUE>")]
[TypeConverter(typeof(CatAgilityConverter))]
[DefaultValue(10)]
[Description("The agility between 0 and 100.")]
[PositiveNumberValidator("Agility cannot be negative.")]
public int Agility { get; set; }
}

View File

@ -0,0 +1,20 @@
namespace Spectre.Console.Tests.Data;
public sealed class DogSettings : MammalSettings
{
[CommandArgument(0, "<AGE>")]
public int Age { get; set; }
[CommandOption("-g|--good-boy")]
public bool GoodBoy { get; set; }
public override ValidationResult Validate()
{
if (Name == "Tiger")
{
return ValidationResult.Error("Tiger is not a dog name!");
}
return ValidationResult.Success();
}
}

View File

@ -0,0 +1,8 @@
namespace Spectre.Console.Tests.Data;
public class FooCommandSettings : CommandSettings
{
[CommandArgument(0, "[QUX]")]
[Description("The qux value.")]
public string Qux { get; set; }
}

View File

@ -0,0 +1,8 @@
namespace Spectre.Console.Tests.Data;
public sealed class GiraffeSettings : MammalSettings
{
[CommandArgument(0, "<LENGTH>")]
[Description("The option description.")]
public int Length { get; set; }
}

View File

@ -0,0 +1,16 @@
namespace Spectre.Console.Tests.Data;
public sealed class HiddenOptionSettings : CommandSettings
{
[CommandArgument(0, "<FOO>")]
[Description("Dummy argument FOO")]
public int Foo { get; set; }
[CommandOption("--bar", IsHidden = true)]
[Description("You should not be able to read this unless you used the 'cli explain' command with the '--hidden' option")]
public int Bar { get; set; }
[CommandOption("--baz")]
[Description("Dummy option BAZ")]
public int Baz { get; set; }
}

View File

@ -0,0 +1,16 @@
using System.IO;
namespace Spectre.Console.Tests.Data;
public class HorseSettings : MammalSettings
{
[CommandOption("-d|--day <Mon|Tue>")]
public DayOfWeek Day { get; set; }
[CommandOption("--file")]
[DefaultValue("food.txt")]
public FileInfo File { get; set; }
[CommandOption("--directory")]
public DirectoryInfo Directory { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace Spectre.Console.Tests.Data;
public sealed class InvalidSettings : CommandSettings
{
[CommandOption("-f|--foo [BAR]")]
public string Value { get; set; }
}

View File

@ -0,0 +1,21 @@
namespace Spectre.Console.Tests.Data;
public class LionSettings : CatSettings
{
[CommandArgument(0, "<TEETH>")]
[Description("The number of teeth the lion has.")]
public int Teeth { get; set; }
[CommandOption("-c <CHILDREN>")]
[Description("The number of children the lion has.")]
public int Children { get; set; }
[CommandOption("-d <DAY>")]
[Description("The days the lion goes hunting.")]
[DefaultValue(new[] { DayOfWeek.Monday, DayOfWeek.Thursday })]
public DayOfWeek[] HuntDays { get; set; }
[CommandOption("-w|--weight [WEIGHT]")]
[Description("The weight of the lion, in kgs.")]
public FlagValue<int?> Weight { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace Spectre.Console.Tests.Data;
public class MammalSettings : AnimalSettings
{
[CommandOption("-n|-p|--name|--pet-name <VALUE>")]
public string Name { get; set; }
}

View File

@ -0,0 +1,19 @@
namespace Spectre.Console.Tests.Data;
public class MultipleArgumentVectorSettings : CommandSettings
{
[CommandArgument(0, "<Foos>")]
public string[] Foo { get; set; }
[CommandArgument(0, "<Bars>")]
public string[] Bar { get; set; }
}
public class MultipleArgumentVectorSpecifiedFirstSettings : CommandSettings
{
[CommandArgument(1, "[Bar]")]
public string Bar { get; set; }
[CommandArgument(0, "<Foos>")]
public string[] Foo { get; set; }
}

View File

@ -0,0 +1,10 @@
namespace Spectre.Console.Tests.Data;
public class OptionVectorSettings : CommandSettings
{
[CommandOption("--foo")]
public string[] Foo { get; set; }
[CommandOption("--bar")]
public int[] Bar { get; set; }
}

View File

@ -0,0 +1,50 @@
namespace Spectre.Console.Tests.Data;
public sealed class OptionalArgumentWithDefaultValueSettings : CommandSettings
{
[CommandArgument(0, "[GREETING]")]
[DefaultValue("Hello World")]
public string Greeting { get; set; }
}
public sealed class OptionalArgumentWithPropertyInitializerSettings : CommandSettings
{
[CommandArgument(0, "[NAMES]")]
public string[] Names { get; set; } = Array.Empty<string>();
[CommandOption("-c")]
public int Count { get; set; } = 1;
[CommandOption("--value")]
public int Value { get; set; } = 0;
}
public sealed class OptionalArgumentWithDefaultValueAndTypeConverterSettings : CommandSettings
{
[CommandArgument(0, "[GREETING]")]
[DefaultValue("5")]
[TypeConverter(typeof(StringToIntegerConverter))]
public int Greeting { get; set; }
}
public sealed class RequiredArgumentWithDefaultValueSettings : CommandSettings
{
[CommandArgument(0, "<GREETING>")]
[DefaultValue("Hello World")]
public string Greeting { get; set; }
}
public sealed class OptionWithArrayOfEnumDefaultValueSettings : CommandSettings
{
[CommandOption("--days")]
[DefaultValue(new[] { DayOfWeek.Sunday, DayOfWeek.Saturday })]
public DayOfWeek[] Days { get; set; }
}
public sealed class OptionWithArrayOfStringDefaultValueAndTypeConverterSettings : CommandSettings
{
[CommandOption("--numbers")]
[DefaultValue(new[] { "2", "3" })]
[TypeConverter(typeof(StringToIntegerConverter))]
public int[] Numbers { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace Spectre.Console.Tests.Data;
public class ReptileSettings : AnimalSettings
{
[CommandOption("-n|-p|--name|--pet-name <VALUE>")]
public string Name { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace Spectre.Console.Tests.Data;
public sealed class StringOptionSettings : CommandSettings
{
[CommandOption("-f|--foo")]
public string Foo { get; set; }
}

View File

@ -0,0 +1,5 @@
namespace Spectre.Console.Tests.Data;
public sealed class ThrowingCommandSettings : CommandSettings
{
}

View File

@ -0,0 +1,16 @@
namespace Spectre.Console.Tests.Data;
public sealed class TurtleSettings : ReptileSettings
{
public TurtleSettings(string name)
{
Name = name;
}
public override ValidationResult Validate()
{
return Name != "Lonely George"
? ValidationResult.Error("Only 'Lonely George' is valid name for a turtle!")
: ValidationResult.Success();
}
}

View File

@ -0,0 +1,7 @@
namespace Spectre.Console.Tests.Data;
public sealed class VersionSettings : CommandSettings
{
[CommandOption("-v|--version")]
public string Version { get; set; }
}

View File

@ -0,0 +1,25 @@
namespace Spectre.Console.Tests.Data;
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public sealed class EvenNumberValidatorAttribute : ParameterValidationAttribute
{
public EvenNumberValidatorAttribute(string errorMessage)
: base(errorMessage)
{
}
public override ValidationResult Validate(CommandParameterContext context)
{
if (context.Value is int integer)
{
if (integer % 2 == 0)
{
return ValidationResult.Success();
}
return ValidationResult.Error($"Number is not even ({context.Parameter.PropertyName}).");
}
throw new InvalidOperationException($"Parameter is not a number ({context.Parameter.PropertyName}).");
}
}

View File

@ -0,0 +1,25 @@
namespace Spectre.Console.Tests.Data;
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public sealed class PositiveNumberValidatorAttribute : ParameterValidationAttribute
{
public PositiveNumberValidatorAttribute(string errorMessage)
: base(errorMessage)
{
}
public override ValidationResult Validate(CommandParameterContext context)
{
if (context.Value is int integer)
{
if (integer > 0)
{
return ValidationResult.Success();
}
return ValidationResult.Error($"Number is not greater than 0 ({context.Parameter.PropertyName}).");
}
throw new InvalidOperationException($"Parameter is not a number ({context.Parameter.PropertyName}).");
}
}

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Arguments can not contain options.
--foo <BAR>
^^^^^ Not permitted

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Encountered invalid character '$' in option name.
--f$oo
^ Invalid character

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Encountered invalid character '$' in value name.
-f|--foo <F$OO>
^ Invalid character

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Long option names must consist of more than one character.
--f
^ Invalid option name

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
No long or short name for option has been specified.
<FOO>
^^^^^ Missing option. Was this meant to be an argument?

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Multiple option values are not supported.
-f|--foo <FOO> <BAR>
^^^^^ Too many option values

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Multiple values are not supported.
<FOO> <BAR>
^^^^^ Too many values

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Option names cannot start with a digit.
--1foo
^^^^ Invalid option name

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Options without name are not allowed.
--foo|-
^ Missing option name

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Short option names can not be longer than one character.
--foo|-bar
^^^ Invalid option name

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Encountered unexpected character '$'.
<FOO> $ <BAR>
^ Unexpected character

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Encountered unterminated value name 'BAR'.
--foo|-f <BAR
^^^^ Unterminated value name

View File

@ -0,0 +1,5 @@
Error: An error occured when parsing template.
Values without name are not allowed.
<>
^^ Missing value name

View File

@ -0,0 +1,12 @@
USAGE:
myapp <FOO> <BAR> <BAZ> <CORGI> [QUX] [OPTIONS]
ARGUMENTS:
<FOO>
<BAR>
<BAZ>
<CORGI>
[QUX]
OPTIONS:
-h, --help Prints help information

View File

@ -0,0 +1,18 @@
DESCRIPTION:
Contains settings for a cat.
USAGE:
myapp cat [LEGS] [OPTIONS] <COMMAND>
ARGUMENTS:
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
COMMANDS:
lion <TEETH> The lion command

View File

@ -0,0 +1,18 @@
DESCRIPTION:
Contains settings for a cat.
USAGE:
myapp cat [LEGS] [OPTIONS] <COMMAND>
ARGUMENTS:
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
COMMANDS:
lion <TEETH> The lion command

View File

@ -0,0 +1,11 @@
USAGE:
myapp branch [GREETING] [OPTIONS] [COMMAND]
ARGUMENTS:
[GREETING]
OPTIONS:
-h, --help Prints help information
COMMANDS:
greeter

View File

@ -0,0 +1,30 @@
DESCRIPTION:
The animal command.
USAGE:
myapp animal [LEGS] [OPTIONS] <COMMAND>
EXAMPLES:
myapp animal dog --name Rufus --age 12 --good-boy
myapp animal dog --name Luna
myapp animal dog --name Charlie
myapp animal dog --name Bella
myapp animal dog --name Daisy
myapp animal dog --name Milo
myapp animal horse --name Brutus
myapp animal horse --name Sugar --IsAlive false
myapp animal horse --name Cash
myapp animal horse --name Dakota
myapp animal horse --name Cisco
myapp animal horse --name Spirit
ARGUMENTS:
[LEGS] The number of legs
OPTIONS:
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
COMMANDS:
dog <AGE> The dog command
horse The horse command

View File

@ -0,0 +1,17 @@
DESCRIPTION:
Contains settings for a cat.
USAGE:
myapp cat [LEGS] [OPTIONS] <COMMAND>
ARGUMENTS:
[LEGS] The number of legs
OPTIONS:
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> The agility between 0 and 100
COMMANDS:
lion <TEETH> The lion command

View File

@ -0,0 +1,14 @@
--------------------------------------
--- CUSTOM HELP PROVIDER ---
--------------------------------------
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
Version 1.0

View File

@ -0,0 +1 @@
Help has moved online. Please see: http://www.example.com

View File

@ -0,0 +1,14 @@
--------------------------------------
--- CUSTOM HELP PROVIDER ---
--------------------------------------
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
Version 1.0

View File

@ -0,0 +1 @@
Help has moved online. Please see: http://www.example.com

View File

@ -0,0 +1,19 @@
DESCRIPTION:
The lion command.
USAGE:
myapp <TEETH> [LEGS] [OPTIONS]
ARGUMENTS:
<TEETH> The number of teeth the lion has
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs

View File

@ -0,0 +1,15 @@
--------------------------------------
--- CUSTOM HELP PROVIDER ---
--------------------------------------
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
-v, --version Prints version information
COMMANDS:
dog <AGE> The dog command
Version 1.0

View File

@ -0,0 +1,23 @@
DESCRIPTION:
The dog command.
USAGE:
myapp <AGE> [LEGS] [OPTIONS]
EXAMPLES:
myapp --name Rufus --age 12 --good-boy
myapp --name Luna
myapp --name Charlie
myapp --name Bella
myapp --name Daisy
myapp --name Milo
ARGUMENTS:
<AGE>
[LEGS] The number of legs
OPTIONS:
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
-g, --good-boy

View File

@ -0,0 +1,19 @@
DESCRIPTION:
The lion command.
USAGE:
myapp <TEETH> [LEGS] [OPTIONS]
ARGUMENTS:
<TEETH> The number of teeth the lion has
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs

View File

@ -0,0 +1,25 @@
BESCHREIBUNG:
The lion command.
VERWENDUNG:
myapp <TEETH> [LEGS] [OPTIONEN] [KOMMANDO]
BEISPIELE:
myapp 20 --alive
ARGUMENTE:
<TEETH> The number of teeth the lion has
[LEGS] The number of legs
OPTIONEN:
STANDARDWERT
-h, --help Zeigt Hilfe an
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs
KOMMANDOS:
giraffe <LENGTH> The giraffe command

View File

@ -0,0 +1,25 @@
DESCRIPTION:
The lion command.
USAGE:
myapp <TEETH> [LEGS] [OPTIONS] [COMMAND]
EXAMPLES:
myapp 20 --alive
ARGUMENTS:
<TEETH> The number of teeth the lion has
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs
COMMANDS:
giraffe <LENGTH> The giraffe command

View File

@ -0,0 +1,25 @@
DESCRIPTION:
The lion command.
UTILISATION:
myapp <TEETH> [LEGS] [OPTIONS] [COMMANDE]
EXEMPLES:
myapp 20 --alive
ARGUMENTS:
<TEETH> The number of teeth the lion has
[LEGS] The number of legs
OPTIONS:
DÉFAUT
-h, --help Affiche l'aide
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs
COMMANDES:
giraffe <LENGTH> The giraffe command

View File

@ -0,0 +1,25 @@
BESKRIVNING:
The lion command.
ANVÄNDING:
myapp <TEETH> [LEGS] [VAL] [KOMMANDO]
EXEMPEL:
myapp 20 --alive
ARGUMENT:
<TEETH> The number of teeth the lion has
[LEGS] The number of legs
VAL:
STANDARD
-h, --help Skriver ut hjälpinformation
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
--agility <VALUE> 10 The agility between 0 and 100
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs
KOMMANDON:
giraffe <LENGTH> The giraffe command

View File

@ -0,0 +1,25 @@
[bold]DESCRIPTION:[/]
The lion command.
[bold]USAGE:[/]
myapp []<TEETH>[/] [][[LEGS]][/] [][[OPTIONS]][/] [][[COMMAND]][/]
[bold]EXAMPLES:[/]
myapp []20 --alive[/]
[bold]ARGUMENTS:[/]
[]<TEETH>[/] The number of teeth the lion has
[][[LEGS]][/] The number of legs
[]OPTIONS:[/]
[]DEFAULT[/]
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name []<VALUE>[/]
--agility []<VALUE>[/] []10[/] The agility between 0 and 100
-c []<CHILDREN>[/] The number of children the lion has
-d []<DAY>[/] []Monday[/], []Thursday[/] The days the lion goes hunting
-w, --weight [][[WEIGHT]][/] The weight of the lion, in kgs
[bold]COMMANDS:[/]
[]giraffe[/] []<LENGTH>[/] The giraffe command

View File

@ -0,0 +1,25 @@
[yellow]DESCRIPTION:[/]
The lion command.
[yellow]USAGE:[/]
myapp [aqua]<TEETH>[/] [silver][[LEGS]][/] [grey][[OPTIONS]][/] [aqua][[COMMAND]][/]
[yellow]EXAMPLES:[/]
myapp [grey]20 --alive[/]
[yellow]ARGUMENTS:[/]
[silver]<TEETH>[/] The number of teeth the lion has
[silver][[LEGS]][/] The number of legs
[yellow]OPTIONS:[/]
[lime]DEFAULT[/]
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name [silver]<VALUE>[/]
--agility [silver]<VALUE>[/] [bold]10[/] The agility between 0 and 100
-c [silver]<CHILDREN>[/] The number of children the lion has
-d [silver]<DAY>[/] [bold]Monday[/], [bold]Thursday[/] The days the lion goes hunting
-w, --weight [grey][[WEIGHT]][/] The weight of the lion, in kgs
[yellow]COMMANDS:[/]
[silver]giraffe[/] [silver]<LENGTH>[/] The giraffe command

View File

@ -0,0 +1,25 @@
[]DESCRIPTION:[/]
The lion command.
[]USAGE:[/]
myapp []<TEETH>[/] [][[LEGS]][/] [][[OPTIONS]][/] [][[COMMAND]][/]
[]EXAMPLES:[/]
myapp []20 --alive[/]
[]ARGUMENTS:[/]
[]<TEETH>[/] The number of teeth the lion has
[][[LEGS]][/] The number of legs
[]OPTIONS:[/]
[]DEFAULT[/]
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name []<VALUE>[/]
--agility []<VALUE>[/] []10[/] The agility between 0 and 100
-c []<CHILDREN>[/] The number of children the lion has
-d []<DAY>[/] []Monday[/], []Thursday[/] The days the lion goes hunting
-w, --weight [][[WEIGHT]][/] The weight of the lion, in kgs
[]COMMANDS:[/]
[]giraffe[/] []<LENGTH>[/] The giraffe command

View File

@ -0,0 +1,9 @@
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command.
horse The horse command.

View File

@ -0,0 +1,9 @@
USAGE:
myapp <FOO> [OPTIONS]
ARGUMENTS:
<FOO> Dummy argument FOO
OPTIONS:
-h, --help Prints help information
--baz Dummy option BAZ

View File

@ -0,0 +1,9 @@
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command

View File

@ -0,0 +1,15 @@
DESCRIPTION:
The lion command.
USAGE:
myapp cat [LEGS] lion <TEETH> [OPTIONS]
ARGUMENTS:
<TEETH> The number of teeth the lion has
OPTIONS:
DEFAULT
-h, --help Prints help information
-c <CHILDREN> The number of children the lion has
-d <DAY> Monday, Thursday The days the lion goes hunting
-w, --weight [WEIGHT] The weight of the lion, in kgs

View File

@ -0,0 +1,8 @@
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
bar

View File

@ -0,0 +1,12 @@
USAGE:
myapp <FOO> <BAR> <BAZ> <CORGI> [QUX] [OPTIONS]
ARGUMENTS:
<FOO>
<BAR>
<BAZ>
<CORGI>
[QUX]
OPTIONS:
-h, --help Prints help information

View File

@ -0,0 +1,10 @@
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command
giraffe <LENGTH> The giraffe command

View File

@ -0,0 +1,10 @@
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command
giraffe <LENGTH> The giraffe command

View File

@ -0,0 +1,17 @@
DESCRIPTION:
The horse command.
USAGE:
myapp horse [LEGS] [OPTIONS]
ARGUMENTS:
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
-d, --day <MON|TUE>
--file food.txt
--directory

View File

@ -0,0 +1,17 @@
DESCRIPTION:
The horse command.
USAGE:
myapp horse [LEGS] [OPTIONS]
ARGUMENTS:
[LEGS] The number of legs
OPTIONS:
DEFAULT
-h, --help Prints help information
-a, --alive Indicates whether or not the animal is alive
-n, --name <VALUE>
-d, --day <MON|TUE>
--file food.txt
--directory

View File

@ -0,0 +1,23 @@
USAGE:
myapp [OPTIONS] <COMMAND>
EXAMPLES:
myapp dog --name Rufus --age 12 --good-boy
myapp dog --name Luna
myapp dog --name Charlie
myapp dog --name Bella
myapp dog --name Daisy
myapp dog --name Milo
myapp horse --name Brutus
myapp horse --name Sugar --IsAlive false
myapp horse --name Cash
myapp horse --name Dakota
myapp horse --name Cisco
myapp horse --name Spirit
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command

View File

@ -0,0 +1,16 @@
USAGE:
myapp [OPTIONS] <COMMAND>
EXAMPLES:
myapp dog --name Rufus --age 12 --good-boy
myapp dog --name Luna
myapp dog --name Charlie
myapp dog --name Bella
myapp dog --name Daisy
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command

View File

@ -0,0 +1,19 @@
USAGE:
myapp [OPTIONS] <COMMAND>
EXAMPLES:
myapp dog --name Rufus --age 12 --good-boy
myapp dog --name Luna
myapp dog --name Charlie
myapp dog --name Bella
myapp dog --name Daisy
myapp dog --name Milo
myapp horse --name Brutus
myapp horse --name Sugar --IsAlive false
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command

View File

@ -0,0 +1,9 @@
USAGE:
myapp [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command

View File

@ -0,0 +1,23 @@
USAGE:
myapp [OPTIONS] <COMMAND>
EXAMPLES:
myapp dog --name Rufus --age 12 --good-boy
myapp dog --name Luna
myapp dog --name Charlie
myapp dog --name Bella
myapp dog --name Daisy
myapp dog --name Milo
myapp horse --name Brutus
myapp horse --name Sugar --IsAlive false
myapp horse --name Cash
myapp horse --name Dakota
myapp horse --name Cisco
myapp horse --name Spirit
OPTIONS:
-h, --help Prints help information
COMMANDS:
dog <AGE> The dog command
horse The horse command

Some files were not shown because too many files have changed in this diff Show More