mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-21 17:35:47 +08:00
Move Spectre.Console.Cli to it's own package
This commit is contained in:
committed by
Patrik Svensson
parent
b600832e00
commit
36ca22ffac
@@ -0,0 +1,25 @@
|
||||
namespace Spectre.Console.Cli;
|
||||
|
||||
public static class CommandContextExtensions
|
||||
{
|
||||
public static void ShouldHaveRemainingArgument(this CommandContext context, string name, string[] values)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
if (values == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(values));
|
||||
}
|
||||
|
||||
context.Remaining.Parsed.Contains(name).ShouldBeTrue();
|
||||
context.Remaining.Parsed[name].Count().ShouldBe(values.Length);
|
||||
|
||||
foreach (var value in values)
|
||||
{
|
||||
context.Remaining.Parsed[name].ShouldContain(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#if !NET5_0_OR_GREATER
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
public sealed class ModuleInitializerAttribute : Attribute
|
||||
{
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user