private static string GetSymbolResultValue(ParseResult parseResult, SymbolResult symbolResult) { if (symbolResult.Token() == null) { return(parseResult.FindResultFor(Parser.DotnetSubCommand)?.GetValueOrDefault <string>()); } else if (symbolResult.Token().Type.Equals(TokenType.Command)) { return(symbolResult.Symbol.Name); } else { return(string.Empty); } }
public override string RequiredArgumentMissing(SymbolResult symbolResult) => symbolResult is CommandResult ? string.Format(LocalizableStrings.RequiredCommandArgumentMissing, symbolResult.Token().Value) : string.Format(LocalizableStrings.RequiredOptionArgumentMissing, symbolResult.Token().Value);
public override string NoArgumentProvided(SymbolResult symbolResult) => symbolResult is CommandResult ? string.Format(LocalizableStrings.RequiredArgumentMissingForCommand, symbolResult.Token().Value) : string.Format(LocalizableStrings.RequiredArgumentMissingForOption, symbolResult.Token().Value);
public override string ExpectsOneArgument(SymbolResult symbolResult) => symbolResult is CommandResult ? string.Format(LocalizableStrings.CommandAcceptsOnlyOneArgument, symbolResult.Token().Value, symbolResult.Tokens.Count) : string.Format(LocalizableStrings.OptionAcceptsOnlyOneArgument, symbolResult.Token().Value, symbolResult.Tokens.Count);