aboutsummaryrefslogtreecommitdiff
path: root/run.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'run.ps1')
-rw-r--r--run.ps120
1 files changed, 17 insertions, 3 deletions
diff --git a/run.ps1 b/run.ps1
index 782fd46..f0c3652 100644
--- a/run.ps1
+++ b/run.ps1
@@ -96,7 +96,8 @@ if ($args.Count -eq 0) {
"nim" { "Nim" }
"exe" { "Binary" }
}
- $entry = " " + $i.ToString().PadRight($num_w) + ") " + $name.PadRight($max_name) + " [$lang]"
+ $displayName = $name -replace '[_\-]', ' '
+ $entry = " " + $i.ToString().PadRight($num_w) + ") " + $displayName.PadRight($max_name) + " [$lang]"
Write-Host ("│" + $entry.PadRight($inner_w) + "│")
$i++
}
@@ -120,8 +121,21 @@ if ($target_name -match '^\d+$') {
}
if (-not $tools.ContainsKey($target_name)) {
- Write-Host "Error: target '$target_name' does not exist"
- exit 1
+ $normalized = $target_name.ToLower() -replace '[ _\-\.]', ''
+ $found = $null
+ foreach ($key in $tools.Keys) {
+ $keyNormalized = $key.ToLower() -replace '[ _\-\.]', ''
+ if ($normalized -eq $keyNormalized) {
+ $found = $key
+ break
+ }
+ }
+ if ($found) {
+ $target_name = $found
+ } else {
+ Write-Host "Error: target '$target_name' does not exist"
+ exit 1
+ }
}
$script_args = $args[1..$args.Count]