示例#1
0
        /// <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));
        }
示例#2
0
 /// <summary>
 /// Gets whether preview directive was specified in the input.
 /// </summary>
 public static bool IsPreviewDirectiveSpecified(this CommandInput commandInput) =>
 commandInput.Directives.Contains("preview", StringComparer.OrdinalIgnoreCase);
示例#3
0
 /// <summary>
 /// Gets whether a command was specified in the input.
 /// </summary>
 public static bool HasArguments(this CommandInput commandInput) => commandInput.Arguments.Any();
示例#4
0
 /// <summary>
 /// Initializes and instance of <see cref="CommandCandidate"/>
 /// </summary>
 public CommandCandidate(CommandSchema schema, IReadOnlyList <string> positionalArgumentsInput, CommandInput commandInput)
 {
     Schema = schema;
     PositionalArgumentsInput = positionalArgumentsInput;
     CommandInput             = commandInput;
 }
示例#5
0
 /// <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));
 }
示例#6
0
 /// <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());
 }