25 references to HasValue
dotnet-user-jwts (25)
Commands\ClearCommand.cs (1)
41return Execute(cmd.Reporter, project, userSecretsId, forceOption.HasValue(), appsettingsFile);
Commands\CreateCommand.cs (19)
135var scheme = schemeNameOption.HasValue() ? schemeNameOption.Value() : "Bearer"; 136var optionsString = schemeNameOption.HasValue() ? $"{Resources.JwtPrint_Scheme}: {scheme}{Environment.NewLine}" : string.Empty; 138var name = nameOption.HasValue() ? nameOption.Value() : Environment.UserName; 141var audience = audienceOption.HasValue() ? audienceOption.Values : DevJwtCliHelpers.GetAudienceCandidatesFromLaunchSettings(project); 142optionsString += audienceOption.HasValue() ? $"{Resources.JwtPrint_Audiences}: {string.Join(", ", audience)}{Environment.NewLine}" : string.Empty; 148var issuer = issuerOption.HasValue() ? issuerOption.Value() : DevJwtsDefaults.Issuer; 149optionsString += issuerOption.HasValue() ? $"{Resources.JwtPrint_Issuer}: {issuer}{Environment.NewLine}" : string.Empty; 152if (notBeforeOption.HasValue()) 163if (expiresOnOption.HasValue()) 171if (validForOption.HasValue()) 183if (validForOption.HasValue()) 191if (expiresOnOption.HasValue()) 202var roles = rolesOption.HasValue() ? rolesOption.Values : new List<string>(); 203optionsString += rolesOption.HasValue() ? $"{Resources.JwtPrint_Roles}: [{string.Join(", ", roles)}]{Environment.NewLine}" : string.Empty; 205var scopes = scopesOption.HasValue() ? scopesOption.Values : new List<string>(); 206optionsString += scopesOption.HasValue() ? $"{Resources.JwtPrint_Scopes}: {string.Join(", ", scopes)}{Environment.NewLine}" : string.Empty; 209if (claimsOption.HasValue()) 220if (appsettingsFileOption.HasValue()) 224optionsString += appsettingsFileOption.HasValue() ? $"{Resources.JwtPrint_appsettingsFile}: {appsettingsFile}{Environment.NewLine}" : string.Empty;
Commands\KeyCommand.cs (2)
47resetOption.HasValue(), forceOption.HasValue());
Commands\ListCommand.cs (1)
27return Execute(cmd.Reporter, cmd.ProjectOption.Value(), showTokensOption.HasValue(), cmd.OutputOption.Value());
Commands\PrintCommand.cs (1)
33showAllOption.HasValue(),
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
100return HasValue() ? Values[0] : null;