Пример #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());
 }