Browse Source

sde-wrapper: enhanced to support multiple [\t ]+ delimited aliases on a single ^#Alias: line

karasz/new-early
Alejandro Mery 16 years ago
parent
commit
c53d11398b
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      lib/sde-wrapper-discriminator.in
  2. +3
    -3
      lib/sde-wrapper.in

+ 2
- 2
lib/sde-wrapper-discriminator.in

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# #
# Filename: lib/sde-wrapper-discriminator.in # 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. # More information can be found in the files COPYING and README.
# #
@ -54,7 +54,7 @@ sde_wrapper_discriminator() {
echo "$1" echo "$1"
elif [ -n "$discriminators" ]; then elif [ -n "$discriminators" ]; then
# given token may be an alias of a valid discriminator for this command # 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" ) echo $( sde_wrapper_name "$combin" )
fi fi
} }

+ 3
- 3
lib/sde-wrapper.in

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# #
# Filename: lib/sde-wrapper.in # 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. # More information can be found in the files COPYING and README.
# #
@ -19,11 +19,11 @@ sde_wrapper_name() {
# returns the description of the wrapper # returns the description of the wrapper
sde_wrapper_desc() { 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 # returns an space delimited list of aliases of a wrapper
sde_wrapper_aliases() { 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/ *$//' sed -e 's/^ *//' -e 's/ *$//'
} }

Loading…
Cancel
Save