Files
Scoop/lib/help.ps1
T
Roy Ivy III 6d9bca805f whitespace cleanup
* makes changes to almost all main repo files to be in accordance with .editorconfig
* some files in "test\fixtures\..." were left alone to avoid breaking tests
* NOTE: whitespace changes *only* (`git diff -b` shows no changes)
2015-08-17 22:54:43 -05:00

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)
}