mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-07 04:58:15 +08:00
Command line argument parsing improvements (#1048)
* Support negative numbers as command option values * Support command line options before arguments * POSIX-compliant handling of quotes (double and single, terminated and unterminated), whitespace, hyphens, and special characters (e.g. emojis)
This commit is contained in:
@ -91,11 +91,6 @@ public sealed class CommandParseException : CommandRuntimeException
|
||||
return CommandLineParseExceptionFactory.Create(reader.Original, token, "Invalid long option name.", "Invalid character.");
|
||||
}
|
||||
|
||||
internal static CommandParseException UnterminatedQuote(string input, CommandTreeToken token)
|
||||
{
|
||||
return CommandLineParseExceptionFactory.Create(input, token, $"Encountered unterminated quoted string '{token.Value}'.", "Did you forget the closing quotation mark?");
|
||||
}
|
||||
|
||||
internal static CommandParseException UnknownCommand(CommandModel model, CommandTree? node, IEnumerable<string> args, CommandTreeToken token)
|
||||
{
|
||||
var suggestion = CommandSuggestor.Suggest(model, node?.Command, token.Value);
|
||||
|
Reference in New Issue
Block a user