Skip to content

Commit 3ae389a

Browse files
StartAutomatingStartAutomating
authored andcommitted
[CommandAST].AsSentence : Prioritizing aliases over parameters (Fixes #260)
1 parent 8cf1ace commit 3ae389a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

PipeScript.types.ps1xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,18 +540,20 @@ foreach ($potentialCommand in $potentialCommands) {
540540
# Walk over each potential parameter in the command
541541
foreach ($potentialParameter in $potentialParameters.Values) {
542542
$parameterFound = $(
543+
# otherwise, we have to check each alias.
544+
:nextAlias foreach ($potentialAlias in $potentialParameter.Aliases) {
545+
if ($potentialBarewordList -contains $potentialAlias) {
546+
$potentialParameterName = $potentialAlias
547+
$true
548+
break
549+
}
550+
}
551+
543552
# If the parameter name matches,
544553
if ($potentialBarewordList -contains $potentialParameter.Name) {
545554
$true # we've found it,
546555
} else {
547-
# otherwise, we have to check each alias.
548-
:nextAlias foreach ($potentialAlias in $potentialParameter.Aliases) {
549-
if ($potentialBarewordList -contains $potentialAlias) {
550-
$potentialParameterName = $potentialAlias
551-
$true
552-
break
553-
}
554-
}
556+
555557
}
556558
)
557559

0 commit comments

Comments
 (0)