6 instantiations of PromptBinding
aspire (6)
Interaction\PromptBinding.cs (6)
86
new
(_parseResult, SymbolDisplayName, _resolver, newDefault, hasExplicitDefault: true, nonInteractiveDefaultValue: newDefault);
106
new
(parseResult, FormatOptionName(option), BuildOptionResolver(option), default, hasExplicitDefault: false);
109
new
(parseResult, FormatOptionName(option), BuildOptionResolver(option), defaultValue, hasExplicitDefault: true);
116
new
(null, string.Empty, static _ => (false, default), defaultValue, hasExplicitDefault: true);
124
new
(parseResult, FormatOptionName(option), BuildResolver<bool?, bool>(option, value => value != true), defaultValue, hasExplicitDefault: true);
159
new
(parseResult, FormatOptionName(option), BuildResolver<bool?, bool>(option, value => value == true), interactiveDefault, hasExplicitDefault: true, nonInteractiveDefaultValue: nonInteractiveDefault);
122 references to PromptBinding
aspire (60)
Commands\AgentInitCommand.cs (10)
175
PromptBinding
<bool> agentInitBinding,
176
PromptBinding
<string?> agentsBinding,
177
PromptBinding
<string?> skillsBinding,
178
PromptBinding
<AgentConfigurationScope> scopeBinding,
248
PromptBinding
<string?> agentsBinding,
249
PromptBinding
<string?> skillsBinding,
250
PromptBinding
<AgentConfigurationScope> scopeBinding,
251
PromptBinding
<bool>? mcpBinding,
337
var
skillsBindingWithDefault = skillsBinding.WithDefault(defaultSkillNames);
691
private static bool ShouldSkipBundleCatalogResolution(
PromptBinding
<string?> skillsBinding)
Commands\InitCommand.cs (1)
175
var
agentInitBinding = PromptBinding.CreateInvertedBoolConfirm(parseResult, NewCommand.s_suppressAgentInitOption, defaultValue: true);
Commands\NewCommand.cs (1)
606
var
agentInitBinding = PromptBinding.CreateInvertedBoolConfirm(parseResult, s_suppressAgentInitOption, defaultValue: true);
Commands\UpdateCommand.cs (5)
346
var
channelBinding = PromptBinding.Create(parseResult, _channelOption);
367
var
confirmBinding = PromptBinding.Create(parseResult, s_yesOption, defaultValue: true);
495
private async Task HandlePendingMigrationsAsync(bool applyRequested, FileInfo projectFile,
PromptBinding
<bool> confirmBinding, CancellationToken cancellationToken)
591
PromptBinding
<bool> confirmBinding,
754
var
channelBinding = PromptBinding.Create(parseResult, _channelOption);
Interaction\ConsoleInteractionService.cs (7)
218
public async Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
281
public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
286
public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
350
public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
665
public async Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)
847
internal T MatchChoiceOrThrow<T>(string value,
PromptBinding
<string?> binding, IEnumerable<T> choices, Func<T, string> choiceFormatter) where T : notnull
859
internal IReadOnlyList<T> MatchChoicesOrThrow<T>(string value,
PromptBinding
<string?> binding, IEnumerable<T> choices, Func<T, string> choiceFormatter) where T : notnull
Interaction\ExtensionInteractionService.cs (5)
145
public async Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
202
public async Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
271
public async Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)
309
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
347
IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
Interaction\IInteractionService.cs (5)
25
Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default);
26
Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default);
27
public Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default);
28
Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull;
29
Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull;
Interaction\PromptBinding.cs (16)
83
/// Creates a new <see cref="
PromptBinding
{T}"/> with the same resolver but a different default value.
85
public
PromptBinding
<T> WithDefault(T? newDefault) =>
90
/// Factory methods for creating <see cref="
PromptBinding
{T}"/> instances.
94
public static (bool WasProvided, T? OptionValue, T? DefaultValue) Resolve<T>(
PromptBinding
<T>? binding)
105
public static
PromptBinding
<T> Create<T>(ParseResult parseResult, Option<T> option) =>
108
public static
PromptBinding
<T> Create<T>(ParseResult parseResult, Option<T> option, T defaultValue) =>
112
/// Creates a <see cref="
PromptBinding
{T}"/> with only a default value and no CLI symbol binding.
115
public static
PromptBinding
<T> CreateDefault<T>(T defaultValue) =>
119
/// Creates a <see cref="
PromptBinding
{T}"/> for a <c>bool?</c> option that resolves to the inverse of its value.
123
public static
PromptBinding
<bool> CreateInvertedBoolConfirm(ParseResult parseResult, Option<bool?> option, bool defaultValue) =>
127
/// Creates a <see cref="
PromptBinding
{T}"/> for a <c>bool?</c> option that maps to a confirmation prompt.
136
/// A <see cref="
PromptBinding
{T}"/> that resolves the explicitly provided <c>bool?</c> option to a <see cref="bool"/>,
140
public static
PromptBinding
<bool> CreateBoolConfirm(ParseResult parseResult, Option<bool?> option, bool defaultValue) =>
144
/// Creates a <see cref="
PromptBinding
{T}"/> for a <c>bool?</c> option that maps to a confirmation prompt.
154
/// A <see cref="
PromptBinding
{T}"/> that resolves the explicitly provided <c>bool?</c> option to a <see cref="bool"/>,
158
public static
PromptBinding
<bool> CreateBoolConfirm(ParseResult parseResult, Option<bool?> option, bool interactiveDefault, bool nonInteractiveDefault) =>
Projects\IAppHostProject.cs (2)
43
public required Interaction.
PromptBinding
<bool> ConfirmBinding { get; init; }
49
public required Interaction.
PromptBinding
<string?> NuGetConfigDirBinding { get; init; }
Projects\ProjectUpdater.cs (1)
217
var
nugetConfigDirBinding = context.NuGetConfigDirBinding.WithDefault(recommendedNuGetConfigDirectory.FullName);
Projects\RepositoryToolUpdater.cs (1)
86
public async Task<RepositoryToolUpdateResult> UpdateAsync(IReadOnlyList<RepositoryToolManifest> manifests, PackageChannel channel,
PromptBinding
<bool> confirmBinding, CancellationToken cancellationToken)
Templating\CliTemplateFactory.EmptyTemplate.cs (1)
134
var
binding = PromptBinding.CreateBoolConfirm(parseResult, _localhostTldOption, defaultValue: false);
Templating\CliTemplateFactory.PythonStarterTemplate.cs (1)
129
var
binding = PromptBinding.CreateBoolConfirm(parseResult, _useRedisCacheOption, interactiveDefault: true, nonInteractiveDefault: false);
Templating\DotNetTemplateFactory.cs (4)
289
var
binding = PromptBinding.CreateBoolConfirm(result, _localhostTldOption, defaultValue: false);
305
var
binding = PromptBinding.CreateBoolConfirm(result, _useRedisCacheOption, interactiveDefault: true, nonInteractiveDefault: false);
321
var
binding = PromptBinding.Create(result, _testFrameworkOption);
365
var
binding = PromptBinding.Create(result, _xunitVersionOption, "v3mtp");
Aspire.Cli.Tests (62)
Commands\PublishCommandPromptingIntegrationTests.cs (5)
1161
public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
1177
public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
1180
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
1200
public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
1218
public Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)
Commands\UpdateCommandTests.cs (5)
3707
public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
3709
public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
3711
public Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)
3713
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
3715
public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
Interaction\ConsoleInteractionServiceTests.cs (30)
1373
var
binding = PromptBinding.Create(parseResult, option);
1388
var
binding = PromptBinding.CreateDefault<string?>("");
1401
var
binding = PromptBinding.CreateDefault<string?>("good-value");
1436
var
binding = PromptBinding.Create(parseResult, option);
1449
var
binding = PromptBinding.CreateDefault(true);
1466
var
binding = PromptBinding.CreateBoolConfirm(parseResult, option, interactiveDefault: true, nonInteractiveDefault: false);
1483
var
binding = PromptBinding.CreateBoolConfirm(parseResult, option, interactiveDefault: true, nonInteractiveDefault: false);
1550
var
binding = PromptBinding.CreateDefault("test");
1566
var
binding = PromptBinding.Create(parseResult, option);
1578
var
binding = PromptBinding.Create(parseResult, option, true);
1594
var
binding = PromptBinding.Create(parseResult, option);
1623
var
binding = PromptBinding.Create(parseResult, option);
1645
var
binding = PromptBinding.Create(parseResult, option);
1672
var
binding = PromptBinding.Create(parseResult, option);
1698
var
binding = PromptBinding.Create(parseResult, option);
1730
var
binding = PromptBinding.Create(parseResult, option);
1756
var
binding = PromptBinding.Create(parseResult, option, "option2");
1774
var
binding = PromptBinding.Create(parseResult, option);
1792
var
binding = PromptBinding.Create(parseResult, option);
1808
var
binding = PromptBinding.CreateInvertedBoolConfirm(parseResult, option, defaultValue: true);
1820
var
binding = PromptBinding.CreateBoolConfirm(parseResult, option, defaultValue: false);
1828
var
binding = PromptBinding.CreateDefault("original");
1829
var
updated = binding.WithDefault("new-value");
1865
var
binding = PromptBinding.CreateDefault<string?>("fallback");
1881
var
binding = PromptBinding.Create(parseResult, option);
1898
var
binding = PromptBinding.Create(parseResult, option);
1917
var
binding = PromptBinding.Create(parseResult, option);
1936
var
binding = PromptBinding.Create(parseResult, option, "option2");
1955
var
binding = PromptBinding.Create(parseResult, option, "alpha,beta");
1971
var
binding = PromptBinding.Create(command.Parse(""), option, "copilot,claude,opencode");
Projects\ExtensionGuestLauncherTests.cs (5)
230
public Task<string> PromptForStringAsync(string promptText, Func<string, Spectre.Console.ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
231
public Task<string> PromptForFilePathAsync(string promptText, Func<string, Spectre.Console.ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default) => throw new NotImplementedException();
232
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull => throw new NotImplementedException();
233
public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull => throw new NotImplementedException();
240
public Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Templating\DotNetTemplateFactoryTests.cs (5)
375
public Task<T> PromptForSelectionAsync<T>(string prompt, IEnumerable<T> choices, Func<T, string> displaySelector,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
378
public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
381
public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
384
public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
387
public Task<bool> PromptConfirmAsync(string prompt,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)
TestServices\TestExtensionInteractionService.cs (6)
33
public Func<string, Func<string, ValidationResult>?, bool, bool,
PromptBinding
<string?>?, CancellationToken, Task<string>>? PromptForStringCallback { get; set; }
66
public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
76
public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
81
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
102
public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
210
public Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)
TestServices\TestInteractionService.cs (6)
118
public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false,
PromptBinding
<string?>? binding = null, CancellationToken cancellationToken = default)
131
public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false,
PromptBinding
<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
144
private Task<string> PromptForResponseAsync(Func<string, ValidationResult>? validator,
PromptBinding
<string?>? binding, CancellationToken cancellationToken)
169
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
PromptBinding
<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
210
public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false,
PromptBinding
<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
293
public Task<bool> PromptConfirmAsync(string promptText,
PromptBinding
<bool>? binding = null, CancellationToken cancellationToken = default)