Skip to content

Commit

Permalink
feat(completions): update
Browse files Browse the repository at this point in the history
  • Loading branch information
abgox committed Aug 30, 2024
1 parent 4cb67f9 commit 27e8173
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 402 deletions.
6 changes: 3 additions & 3 deletions completions/psc/hooks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ToolTip = $tip
}
}
foreach ($completion in $PSCompletions.cmd.Keys) {
foreach ($completion in $PSCompletions.data.list) {

$completions += returnCompletion "rm $($completion)" $PSCompletions.replace_content($PSCompletions.info.rm.tip)

Expand All @@ -23,7 +23,7 @@

$completions += returnCompletion "alias rm $($completion)" $PSCompletions.replace_content($PSCompletions.info.alias.rm.tip) 'SpaceTab'

foreach ($alias in $PSCompletions.cmd.$completion) {
foreach ($alias in $PSCompletions.data.alias.$completion) {
$completions += returnCompletion "alias rm $($completion) $($alias)" $PSCompletions.replace_content($PSCompletions.info.alias.rm.tip_v)
}

Expand Down Expand Up @@ -64,7 +64,7 @@
}

foreach ($completion in $PSCompletions.list) {
if ($completion -notin $PSCompletions.cmd.Keys) {
if ($completion -notin $PSCompletions.data.list) {
$completions += returnCompletion "add $($completion)" $PSCompletions.replace_content($PSCompletions.info.add.tip)
}
}
Expand Down
295 changes: 109 additions & 186 deletions completions/psc/language/en-US.json

Large diffs are not rendered by default.

307 changes: 115 additions & 192 deletions completions/psc/language/zh-CN.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion completions/scoop/guid.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cac15449-69cc-4d48-918a-6572b7353cbc
6810ad12-c164-4425-829d-19f9761f416c
18 changes: 9 additions & 9 deletions completions/scoop/hooks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
}
foreach ($_ in scoop bucket known) {
$bucket = $_
$completions += returnCompletion "bucket add $($bucket)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.bucket.add)
$completions += returnCompletion "bucket add $($bucket)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.bucket.add)
}
foreach ($_ in Get-ChildItem "$scoop_path\buckets" 2>$null) {
$bucket = $_.Name
$completions += returnCompletion "bucket rm $($bucket)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.bucket.rm)
$completions += returnCompletion "bucket rm $($bucket)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.bucket.rm)
}
foreach ($_ in @("$scoop_path\apps", "$scoop_global_path\apps")) {
foreach ($item in (Get-ChildItem $_ 2>$null)) {
$app = $item.Name
$path = $item.FullName
$completions += returnCompletion "uninstall $($app)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.uninstall)
$completions += returnCompletion "update $($app)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.update)
$completions += returnCompletion "cleanup $($app)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.cleanup)
$completions += returnCompletion "hold $($app)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.hold)
$completions += returnCompletion "unhold $($app)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.unhold)
$completions += returnCompletion "prefix $($app)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.prefix)
$completions += returnCompletion "uninstall $($app)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.uninstall)
$completions += returnCompletion "update $($app)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.update)
$completions += returnCompletion "cleanup $($app)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.cleanup)
$completions += returnCompletion "hold $($app)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.hold)
$completions += returnCompletion "unhold $($app)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.unhold)
$completions += returnCompletion "prefix $($app)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.prefix)
}
}
foreach ($_ in Get-ChildItem "$scoop_path\cache" -ErrorAction SilentlyContinue) {
Expand All @@ -59,7 +59,7 @@
$part = $_.Name -split "#"
$path = $_.FullName
$cache = $part[0..1] -join "#"
$completions += returnCompletion "cache rm $($cache)" $PSCompletions.replace_content($PSCompletions.data.scoop.info.tip.cache.rm)
$completions += returnCompletion "cache rm $($cache)" $PSCompletions.replace_content($PSCompletions.completions.scoop.info.tip.cache.rm)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion completions/wsl/guid.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
02738147-3be6-4967-a0cd-b5a4252ab4c8
6c7f61a2-f3dd-4b80-9dce-3f8747327fe2
20 changes: 10 additions & 10 deletions completions/wsl/hooks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
foreach ($_ in wsl -l -q) {
$Distro = CleanNul $_
if ($Distro -ne '') {
$tempList += returnCompletion "~ -d $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--distribution')
$tempList += returnCompletion "-d $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--distribution')
$tempList += returnCompletion "~ --distribution $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--distribution')
$tempList += returnCompletion "--distribution $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--distribution')
$tempList += returnCompletion "~ -d $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--distribution')
$tempList += returnCompletion "-d $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--distribution')
$tempList += returnCompletion "~ --distribution $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--distribution')
$tempList += returnCompletion "--distribution $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--distribution')

$tempList += returnCompletion "-s $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--distribution')
$tempList += returnCompletion "--set-default $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--set-default')
$tempList += returnCompletion "-s $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--distribution')
$tempList += returnCompletion "--set-default $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--set-default')

$tempList += returnCompletion "-t $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--set-default')
$tempList += returnCompletion "--terminate $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--terminate')
$tempList += returnCompletion "-t $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--set-default')
$tempList += returnCompletion "--terminate $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--terminate')

$tempList += returnCompletion "--unregister $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--unregister')
$tempList += returnCompletion "--unregister $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--unregister')

$tempList += returnCompletion "--export $($Distro)" $PSCompletions.replace_content($PSCompletions.data.wsl.info.tip.'--export')
$tempList += returnCompletion "--export $($Distro)" $PSCompletions.replace_content($PSCompletions.completions.wsl.info.tip.'--export')
}
}
return $tempList + $completions
Expand Down

0 comments on commit 27e8173

Please sign in to comment.