/// <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)); }
/// <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()); }