mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
21 lines
567 B
C#
21 lines
567 B
C#
using System.Threading.Tasks;
|
|
using CliFx.Attributes;
|
|
using CliFx.Exceptions;
|
|
|
|
namespace CliFx.Tests.Commands
|
|
{
|
|
[Command("cmd")]
|
|
public class CommandExceptionCommand : ICommand
|
|
{
|
|
[CommandOption("code", 'c')]
|
|
public int ExitCode { get; set; } = 133;
|
|
|
|
[CommandOption("msg", 'm')]
|
|
public string? Message { get; set; }
|
|
|
|
[CommandOption("show-help")]
|
|
public bool ShowHelp { get; set; }
|
|
|
|
public ValueTask ExecuteAsync(IConsole console) => throw new CommandException(Message, ExitCode, ShowHelp);
|
|
}
|
|
} |