Skip to content

Commit a6d225e

Browse files
authored
NuGet's dotnet cli commands should use common interactive option (#49944)
1 parent b78f6ef commit a6d225e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Cli/dotnet/Parser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private static RootCommand ConfigureCommandLine(RootCommand rootCommand)
165165
rootCommand.Arguments.Add(DotnetSubCommand);
166166

167167
// NuGet implements several commands in its own repo. Add them to the .NET SDK via the provided API.
168-
NuGet.CommandLine.XPlat.NuGetCommands.Add(rootCommand);
168+
NuGet.CommandLine.XPlat.NuGetCommands.Add(rootCommand, CommonOptions.InteractiveOption(acceptArgument: true));
169169

170170
rootCommand.SetAction(parseResult =>
171171
{

test/dotnet.Tests/CompletionTests/snapshots/pwsh/DotnetCliSnapshotTests.VerifyCompletions.verified.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ Register-ArgumentCompleter -Native -CommandName 'testhost' -ScriptBlock {
670670
'testhost;package;update' {
671671
$staticCompletions = @(
672672
[CompletionResult]::new('--project', '--project', [CompletionResultType]::ParameterName, "Path to a project or solution file, or a directory.")
673-
[CompletionResult]::new('--interactive', '--interactive', [CompletionResultType]::ParameterName, "Allow the command to block and require manual action for operations like authentication.")
673+
[CompletionResult]::new('--interactive', '--interactive', [CompletionResultType]::ParameterName, "Allows the command to stop and wait for user input or action (for example to complete authentication).")
674674
[CompletionResult]::new('--verbosity', '--verbosity', [CompletionResultType]::ParameterName, "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].")
675675
[CompletionResult]::new('--verbosity', '-v', [CompletionResultType]::ParameterName, "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].")
676676
[CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, "Show command line help.")

test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ _testhost() {
668668
(update)
669669
_arguments "${_arguments_options[@]}" : \
670670
'--project=[Path to a project or solution file, or a directory.]: : ' \
671-
'--interactive=[Allow the command to block and require manual action for operations like authentication.]: :((False\:"False" True\:"True" ))' \
671+
'--interactive=[Allows the command to stop and wait for user input or action (for example to complete authentication).]: :((False\:"False" True\:"True" ))' \
672672
'--verbosity=[Set the verbosity level of the command. Allowed values are q\[uiet\], m\[inimal\], n\[ormal\], d\[etailed\], and diag\[nostic\].]: :((d\:"d" detailed\:"detailed" diag\:"diag" diagnostic\:"diagnostic" m\:"m" minimal\:"minimal" n\:"n" normal\:"normal" q\:"q" quiet\:"quiet" ))' \
673673
'-v=[Set the verbosity level of the command. Allowed values are q\[uiet\], m\[inimal\], n\[ormal\], d\[etailed\], and diag\[nostic\].]: :((d\:"d" detailed\:"detailed" diag\:"diag" diagnostic\:"diagnostic" m\:"m" minimal\:"minimal" n\:"n" normal\:"normal" q\:"q" quiet\:"quiet" ))' \
674674
'--help[Show command line help.]' \

0 commit comments

Comments
 (0)