From c882d8cb3d636cd9ec90d61e661a21055ded5659 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 15 Jan 2006 16:35:09 +0000 Subject: [PATCH] Move '-e' to after 'compile|generate' git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3291 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/shorewall | 64 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 3395d8ebd..a5a8606eb 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -502,18 +502,18 @@ help() # usage() # $1 = exit status { - echo "Usage: $(basename $0) [debug|trace] [nolock] [ -x ] [ -q ] [ -f ] [ -v ] [ -n ] [ -e ] " + echo "Usage: $(basename $0) [debug|trace] [nolock] [ -x ] [ -q ] [ -f ] [ -v ] [ -n ] " echo "where is one of:" echo " add [:] ... " echo " allow
..." echo " check [ ]" echo " clear" - echo " compile [ ] " + echo " compile [ -e ] [ -p ] [ ] " echo " delete [:] ... " echo " drop
..." echo " dump" echo " forget [ ]" - echo " generate [ ] " + echo " generate [ -e ] [-p ] [ ] " echo " help [ | host | address ]" echo " hits" echo " ipcalc {
/ |
}" @@ -844,28 +844,66 @@ case "$1" in exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $1 ;; compile|generate) + shift + + done=0 + + while [ $done -eq 0 ]; do + [ $# -eq 0 ] && usage 1 + option=$1 + case $option in + -*) + option=${option#-} + + [ -z "$option" ] && usage 1 + + while [ -n "$option" ]; do + case $option in + e*) + EXPORT=Yes + option=${option#e} + ;; + q*) + QUIET=$(($QUIET + 1 )) + option=${option#q} + ;; + p*) + exportPROGRAM=Yes + option=${option#p} + ;; + *) + usage 1 + ;; + esac + done + shift + ;; + *) + done=1 + ;; + esac + done + file= + case $# in 1) - usage 1 + file=$1 ;; 2) - file=$2 - ;; - 3) [ -n "$SHOREWALL_DIR" ] && usage 2 - if [ ! -d $2 ]; then - if [ -e $2 ]; then - echo "$2 is not a directory" >&2 && exit 2 + if [ ! -d $1 ]; then + if [ -e $1 ]; then + echo "$1 is not a directory" >&2 && exit 2 else - echo "Directory $2 does not exist" >&2 && exit 2 + echo "Directory $1 does not exist" >&2 && exit 2 fi fi - SHOREWALL_DIR=$2 + SHOREWALL_DIR=$1 export SHOREWALL_DIR - file=$3 + file=$2 ;; *) usage 1