mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2025-12-11 18:46:02 +00:00
17 lines
501 B
PowerShell
17 lines
501 B
PowerShell
function usage($text) {
|
|
$text | sls '(?m)^# Usage: ([^\n]*)$' | % { "Usage: " + $_.matches[0].groups[1].value }
|
|
}
|
|
|
|
function summary($text) {
|
|
$text | sls '(?m)^# Summary: ([^\n]*)$' | % { $_.matches[0].groups[1].value }
|
|
}
|
|
|
|
function help($text) {
|
|
$help_lines = $text | sls '(?ms)^# Help:(.(?!^[^#]))*' | % { $_.matches[0].value; }
|
|
$help_lines -replace '(?ms)^#\s?(Help: )?', ''
|
|
}
|
|
|
|
function my_usage { # gets usage for the calling script
|
|
usage (gc $myInvocation.PSCommandPath -raw)
|
|
}
|