Skip to content

Commit 5ccd294

Browse files
edvilmedsplaisted
authored andcommitted
Update cli snapshots
1 parent 37f00f9 commit 5ccd294

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

test/dotnet.Tests/CompletionTests/snapshots/bash/DotnetCliSnapshotTests.VerifyCompletions.verified.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,7 @@ _testhost_tool_execute() {
17931793
COMPREPLY=()
17941794

17951795
opts="--allow-roll-forward --prerelease --configfile --source --add-source --ignore-failed-sources --interactive --yes --verbosity --help"
1796+
opts="$opts $(${COMP_WORDS[0]} complete --position ${COMP_POINT} ${COMP_LINE} 2>/dev/null | tr '\n' ' ')"
17961797

17971798
if [[ $COMP_CWORD == "$1" ]]; then
17981799
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,10 @@ Register-ArgumentCompleter -Native -CommandName 'testhost' -ScriptBlock {
11111111
[CompletionResult]::new('--help', '-h', [CompletionResultType]::ParameterName, "Show command line help.")
11121112
)
11131113
$completions += $staticCompletions
1114+
$text = $commandAst.ToString()
1115+
$dotnetCompleteResults = @(dotnet complete --position $cursorPosition "$text") | Where-Object { $_ -NotMatch "^-|^/" }
1116+
$dynamicCompletions = $dotnetCompleteResults | Foreach-Object { [CompletionResult]::new($_, $_, [CompletionResultType]::ParameterValue, $_) }
1117+
$completions += $dynamicCompletions
11141118
break
11151119
}
11161120
'testhost;vstest' {

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,19 @@ _testhost() {
11741174
'-v=[Set the MSBuild verbosity level. Allowed values are q\[uiet\], m\[inimal\], n\[ormal\], d\[etailed\], and diag\[nostic\].]:LEVEL:((d\:"d" detailed\:"detailed" diag\:"diag" diagnostic\:"diagnostic" m\:"m" minimal\:"minimal" n\:"n" normal\:"normal" q\:"q" quiet\:"quiet" ))' \
11751175
'--help[Show command line help.]' \
11761176
'-h[Show command line help.]' \
1177-
':packageId -- Package reference in the form of a package identifier like '\''Newtonsoft.Json'\'' or package identifier and version separated by '\''@'\'' like '\''[email protected]'\''.: ' \
1177+
':packageId -- Package reference in the form of a package identifier like '\''Newtonsoft.Json'\'' or package identifier and version separated by '\''@'\'' like '\''[email protected]'\''.:->dotnet_dynamic_complete' \
11781178
'*::commandArguments -- arguments forwarded to the tool: ' \
11791179
&& ret=0
1180+
case $state in
1181+
(dotnet_dynamic_complete)
1182+
local completions=()
1183+
local result=$(dotnet complete -- "${original_args[@]}")
1184+
for line in ${(f)result}; do
1185+
completions+=(${(q)line})
1186+
done
1187+
_describe 'completions' $completions && ret=0
1188+
;;
1189+
esac
11801190
;;
11811191
esac
11821192
;;

0 commit comments

Comments
 (0)