FIX: Built-in action help for OS X.

POSIX sed doesn't support regex branches; I don't want to switch to modern regexp (via -E), since that makes more characters special. Rather, expand the alternatives into two sed commands.
This commit is contained in:
Ingo Karkat
2012-05-11 21:18:43 +02:00
parent c0c93c8c0c
commit e48ad81ecc

View File

@@ -314,7 +314,7 @@ actionUsage()
if [ -f "$action" -a -x "$action" ]; then if [ -f "$action" -a -x "$action" ]; then
"$action" usage "$action" usage
else else
builtinActionUsage=$(actionsHelp | sed -ne "/^ ${actionName//\//\\/}\\( \\|\$\\)/,/^\$/p") builtinActionUsage=$(actionsHelp | sed -n -e "/^ ${actionName//\//\\/} /,/^\$/p" -e "/^ ${actionName//\//\\/}$/,/^\$/p")
if [ "$builtinActionUsage" ]; then if [ "$builtinActionUsage" ]; then
echo "$builtinActionUsage" echo "$builtinActionUsage"
echo echo