Exemplo n.º 1
0
        /// <summary>
        /// Gets whether version option was specified in the input.
        /// </summary>
        public static bool IsVersionOptionSpecified(this CommandInput commandInput)
        {
            commandInput.GuardNotNull(nameof(commandInput));

            var firstOption = commandInput.Options.FirstOrDefault();

            return(firstOption != null && CommandOptionSchema.VersionOption.MatchesAlias(firstOption.Alias));
        }
Exemplo n.º 2
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));
 }
Exemplo n.º 3
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());
 }