/// <summary> /// Gets whether version option was specified in the input. /// </summary> public static bool IsVersionOptionSpecified(this CommandInput commandInput) { var firstOption = commandInput.Options.FirstOrDefault(); return(firstOption != null && CommandOptionSchema.VersionOption.MatchesAlias(firstOption.Alias)); }
/// <summary> /// Gets whether preview directive was specified in the input. /// </summary> public static bool IsPreviewDirectiveSpecified(this CommandInput commandInput) => commandInput.Directives.Contains("preview", StringComparer.OrdinalIgnoreCase);
/// <summary> /// Gets whether a command was specified in the input. /// </summary> public static bool HasArguments(this CommandInput commandInput) => commandInput.Arguments.Any();
/// <summary> /// Initializes and instance of <see cref="CommandCandidate"/> /// </summary> public CommandCandidate(CommandSchema schema, IReadOnlyList <string> positionalArgumentsInput, CommandInput commandInput) { Schema = schema; PositionalArgumentsInput = positionalArgumentsInput; CommandInput = commandInput; }
/// <summary> /// Gets whether preview directive was specified in the input. /// </summary> public static bool IsPreviewDirectiveSpecified(this CommandInput commandInput) { commandInput.GuardNotNull(nameof(commandInput)); return(commandInput.Directives.Contains("preview", StringComparer.OrdinalIgnoreCase)); }
/// <summary> /// Gets whether a command was specified in the input. /// </summary> public static bool IsCommandSpecified(this CommandInput commandInput) { commandInput.GuardNotNull(nameof(commandInput)); return(!commandInput.CommandName.IsNullOrWhiteSpace()); }