Skip to content

Commit

Permalink
fix(help): Rename help() to scoop_help() (ScoopInstaller#3564)
Browse files Browse the repository at this point in the history
When a user has an alias named `help`, the `scoop help` command does not work anymore.
To prevent collision with a user alias the function is renamed from `help` to `scoop_help`
  • Loading branch information
ocitrev authored and Ash258 committed Aug 31, 2019
1 parent b77c282 commit 570cd08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/help.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function summary($text) {
$text | Select-String '(?m)^# Summary: ([^\n]*)$' | ForEach-Object { $_.matches[0].groups[1].value }
}

function help($text) {
function scoop_help($text) {
$help_lines = $text | Select-String '(?ms)^# Help:(.(?!^[^#]))*' | ForEach-Object { $_.matches[0].value; }
$help_lines -replace '(?ms)^#\s?(Help: )?', ''
}
Expand Down
2 changes: 1 addition & 1 deletion libexec/scoop-help.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function print_help($cmd) {

$usage = usage $file
$summary = summary $file
$help = help $file
$help = scoop_help $file

if($usage) { "$usage`n" }
if($help) { $help }
Expand Down

0 comments on commit 570cd08

Please sign in to comment.