Skip to content

Commit

Permalink
feat: Get-Interpreter ( Fixes #747 )
Browse files Browse the repository at this point in the history
Simplifying implementation
  • Loading branch information
James Brundage committed Feb 7, 2024
1 parent f99622b commit 07b3b0d
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions Commands/Interpreters/Get-Interpreter.ps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,15 @@ function Get-Interpreter
}
}

$myVerb, $myNoun = $MyInvocation.InvocationName -split '-', 2
if (-not $myNoun) {
$myNoun = $myVerb
$myVerb = "Get"
}

switch ($myVerb) {
Get {
if ($LanguageName) {

$PSInterpreters[$LanguageName]
} else {
$PSInterpreters
}
}
default {
foreach ($arg in $ArgumentList) {
if ($LanguageName) {
$PSInterpreters[$LanguageName]
}

if ($LanguageName) {
foreach ($langName in $LanguageName) {
if ($PSInterpreters.$langName) {
$PSInterpreters.$langName
}


}
}

} else {
$PSInterpreters
}
}
}

0 comments on commit 07b3b0d

Please sign in to comment.