From 1ad65b07041d36f17f0bad7d616e54e65a8e50b3 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 11 Jul 2007 14:28:34 +0000 Subject: [PATCH] * improved `sde help` to ignore bin/sde-*-* which are internal tools git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@21665 10447126-35f2-4685-b0cf-6dd780d3921f --- bin/sde-help | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/sde-help b/bin/sde-help index f808e1f..5b3e4ce 100755 --- a/bin/sde-help +++ b/bin/sde-help @@ -30,7 +30,12 @@ help_list() { echo "Available Commands:" for command in $SDEROOT/bin/sde-*; do # detect command name - id=$( echo "$command" | sed -e 's,.*/sde-,,' ) + case "$command" in + */sde-*-*) continue ;; + */sde-*) id=$( echo "$command" | sed -e 's,.*/sde-,,' ) + ;; + esac + # optional description desc=$( sed -n -e 's,^#Description: \(.*\)$,\1,p' "$command" ) # and valid aliases @@ -61,6 +66,10 @@ elif [ $# -gt 1 ]; then echo_error "Incorrect Syntax." help_usage exit 1 +elif [ "$1" != "${1%-*}" ]; then + # don't accept subcommands + echo_error "Incorrect Syntax." + help_usage elif [ -x "$SDEROOT/bin/sde-$1" ]; then help_command "$1" elif grep -q "^#Alias: $1$" $SDEROOT/bin/sde-* 2> /dev/null; then