Revision: 41595
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41595&view=rev
Author:   brlcad
Date:     2010-12-14 14:46:56 +0000 (Tue, 14 Dec 2010)

Log Message:
-----------
improve iteration over arguments so that each argument is handled one at a 
time, leveraging the shell to group arguments with spaces, instead of assuming 
arguments are space-separated.  The SEARCH option needs spaces for things like 
SEARCH="-type reg".  also print the current settings during help so you can see 
what things are set to before you run.

Modified Paths:
--------------
    brlcad/trunk/sh/conversion.sh

Modified: brlcad/trunk/sh/conversion.sh
===================================================================
--- brlcad/trunk/sh/conversion.sh       2010-12-14 14:27:03 UTC (rev 41594)
+++ brlcad/trunk/sh/conversion.sh       2010-12-14 14:46:56 UTC (rev 41595)
@@ -148,46 +148,44 @@
 ####################
 
 # process the argument list for commands
-for arg in $ARGS ; do
+while test $# -gt 0 ; do
+    arg="$1"
     case "x$arg" in
        x*[hH])
            HELP=1
-           shift
            ;;
        x*[hH][eE][lL][pP])
            HELP=1
-           shift
            ;;
        x*[iI][nN][sS][tT][rR][uU][cC][tT]*)
            INSTRUCTIONS=1
-           shift
            ;;
        x*[qQ][uU][iI][eE][tT])
            QUIET=1
-           shift
            ;;
        x*[vV][eE][rR][bB][oO][sS][eE])
            VERBOSE=1
-           shift
            ;;
        x*=*)
            VAR=`echo $arg | sed 's/=.*//g' | sed 's/^[-]*//g'`
            if test ! "x$VAR" = "x" ; then
                VAL=`echo $arg | sed 's/.*=//g'`
-               CMD="$VAR=$VAL"
+               CMD="$VAR=\"$VAL\""
                eval $CMD
                export $VAR
            fi
-           shift
            ;;
        x*)
+           echo "Ignoring unrecognized option [$arg]"
            ;;
     esac
+    shift
 done
 
 # validate and clean up options (all default to 0)
 booleanize HELP INSTRUCTIONS VERBOSE
 
+
 ###
 # handle instructions before main processing
 ###
@@ -263,10 +261,26 @@
     echo "  verbose"
     echo ""
     echo "Available options:"
-    echo "  GED=/path/to/geometry/editor (default mged)"
-    echo "  SEARCH=/path/to/new/editor (default mged)"
-    echo "  OBJECTS=params (default "" for all objects)"
-    echo "  MAXTIME=#seconds (default 300)"
+    if test "x$GED" = "x" ; then
+       echo "  GED=/path/to/mged (default mged)"
+    else
+       echo "  GED=/path/to/mged (using $GED)"
+    fi
+    if test "x$SEARCH" = "x" ; then
+       echo "  SEARCH=/path/to/search-enabled/mged (default mged)"
+    else
+       echo "  SEARCH=/path/to/search-enabled/mged (using $SEARCH)"
+    fi
+    if test "x$OBJECTS" = "x" ; then
+       echo "  OBJECTS=\"search params\" (default \"\" for all objects)"
+    else
+       echo "  OBJECTS=\"search params\" (using \"$OBJECTS\")"
+    fi
+    if test "x$MAXTIME" = "x" ; then
+       echo "  MAXTIME=#seconds (default 300)"
+    else
+       echo "  MAXTIME=#seconds (using $MAXTIME)"
+    fi
     echo ""
     echo "BRL-CAD is a powerful cross-platform open source solid modeling 
system."
     echo "For more information about BRL-CAD, see http://brlcad.org";


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to