From c53d11398b2db7e6ce83bd527683aabc9bed80ad Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 2 Mar 2009 17:52:28 +0200 Subject: [PATCH] sde-wrapper: enhanced to support multiple [\t ]+ delimited aliases on a single ^#Alias: line --- lib/sde-wrapper-discriminator.in | 4 ++-- lib/sde-wrapper.in | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sde-wrapper-discriminator.in b/lib/sde-wrapper-discriminator.in index e16ab87..377298f 100644 --- a/lib/sde-wrapper-discriminator.in +++ b/lib/sde-wrapper-discriminator.in @@ -2,7 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: lib/sde-wrapper-discriminator.in -# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2008 - 2009 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -54,7 +54,7 @@ sde_wrapper_discriminator() { echo "$1" elif [ -n "$discriminators" ]; then # given token may be an alias of a valid discriminator for this command - combin=$( grep -l "^#Alias: $1$" $discriminators | head -n 1 ) + combin=$(grep -l "^#Alias:[\t ]\+\(.*[\t ]\)\?$1\([\t ].*\)\?\$" $discriminators | head -n 1) echo $( sde_wrapper_name "$combin" ) fi } diff --git a/lib/sde-wrapper.in b/lib/sde-wrapper.in index c8354ba..2cb9490 100644 --- a/lib/sde-wrapper.in +++ b/lib/sde-wrapper.in @@ -2,7 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: lib/sde-wrapper.in -# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2008 - 2009 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -19,11 +19,11 @@ sde_wrapper_name() { # returns the description of the wrapper sde_wrapper_desc() { - sed -n -e 's,^#Description: \(.*\)$,\1,p' "$1" | head -n 1 + sed -n -e 's,^#Description:[\t ]\+\(.*\)$,\1,p' "$1" | head -n 1 } # returns an space delimited list of aliases of a wrapper sde_wrapper_aliases() { - sed -n -e 's,^#Alias: \([^ ]*\)$,\1,p' "$1" | tr '\n' ' ' | + sed -n -e 's,^#Alias:[\t ]\+\(.*\) *$,\1,p' "$1" | tr '\n' ' ' | sed -e 's/^ *//' -e 's/ *$//' }