IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2007, 1:09:39 PM (19 years ago)
Author:
Paul Price
Message:

Changing set_standard_args to employ a filtering approach --- it supplements the command-line instead of providing something that gets added on. Needed to do this because wanted the arguments it provides to be optional, and it really doesn't like to have a zero length string as an argument.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pantasks.pro

    r12241 r12697  
    155155end
    156156
    157 macro set_standard_args
    158   # XXX be careful: $ARGS cannot be resolved as ""
    159   # XXX currently, sprintf is the only good way of creating
    160   # an empty variable
    161   if ($?WORKDIR == 0)
    162     echo error in pantasks: WORKDIR not set
     157macro add_standard_args
     158  if ($0 != 2)
     159    echo "Must pass in the command of interest, and this function will supplement"
    163160    stop
    164161  end
    165   if ($?DBNAME == 0)
    166     echo error in pantasks: DBNAME not set
    167     stop
    168   end
    169   if ("$DBNAME" != "DEFAULT")
    170     $ARGS = --workdir $WORKDIR --dbname $DBNAME
    171   else
    172     $ARGS = --workdir $WORKDIR
     162
     163  local command
     164  $command = $$1
     165
     166  if ($?DBNAME && "$DBNAME" != "DEFAULT")
     167    $command = $command --dbname $DBNAME
    173168  end
    174169  if ($?NOOP != 0)
    175     $ARGS = $ARGS --no-op
    176   end
    177 end
     170    $command = $command --no-op
     171  end
     172  $$1 = $command
     173end
     174
    178175
    179176macro process_exit
Note: See TracChangeset for help on using the changeset viewer.