Skip to content

Commit

Permalink
feat(completions): update scoop
Browse files Browse the repository at this point in the history
  • Loading branch information
abgox committed Dec 19, 2024
1 parent c101203 commit f0c9f74
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion completions/scoop/guid.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
32669e0d-e174-442a-a5f5-3f4df843c40d
158f815b-cab5-407f-94ff-a91275d54230
13 changes: 12 additions & 1 deletion completions/scoop/hooks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,25 @@ function handleCompletions($completions) {
$current_value = $c.Name
$info = $PSCompletions.completions_data.scoop.root.config.$($PSCompletions.guid).Where({ $_.CompletionText -eq $current_value })[0].ToolTip
if (!$info) {
$info = @($PSCompletions.info.current_value + ': ' + $current_value)
$info = @($PSCompletions.info.current_value + ': ' + ($c.Definition -replace '^.+=', ''))
}
if ($current_value -notin $completions_list) {
$tempList += $PSCompletions.return_completion($current_value, $PSCompletions.replace_content($info))
}
}
}
}
'alias' {
switch ($filter_input_arr[1]) {
'rm' {
if ($filter_input_arr.Count -eq 2) {
foreach ($a in (Get-Member -InputObject (scoop config alias) -MemberType NoteProperty)) {
$tempList += $PSCompletions.return_completion($a.Name, ($a.Definition -replace '^.+=', ''))
}
}
}
}
}
}
return $tempList + $completions
}
3 changes: 3 additions & 0 deletions completions/scoop/language/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@
},
{
"name": "rm",
"symbol": [
"SpaceTab"
],
"tip": [
"U: rm <alias>\n",
"Remove command aliases\n",
Expand Down
3 changes: 3 additions & 0 deletions completions/scoop/language/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@
},
{
"name": "rm",
"symbol": [
"SpaceTab"
],
"tip": [
"U: rm <alias>\n",
"移除命令别名\n",
Expand Down

0 comments on commit f0c9f74

Please sign in to comment.