swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: swarm-1.2 and Drone [command-line arguments]


From: Sven N. Thommesen
Subject: Re: swarm-1.2 and Drone [command-line arguments]
Date: Thu, 27 Aug 1998 13:01:07 -0500

At 04:52 PM 8/27/1998 +0100, Steve Emsley wrote:

>
>Sven,
>
>I've recently been leaning towards a DRONE solution to experiment
>management with the Swarm command-line manager.
>
>I'll summarize my solution using a subclassed Argument class.
> <snip>

Thanks, Steve! Seems we have hit on similar solutions here.

>So that works O.K. However, there are problems incorporating this into
>DRONE. All DRONE parameters seem to require -Dparam=value. Although I
>haven't tested it yet it looks like Swarm command-line arguments can
>only be single characters. The simple solution is to just have one
>parameter i.e. the string value of a parameter filename. Then use a
>wrapper similar to the gawrap in the DRONE example directory to write
>that parameter file.

Hmmmm.

Swarm's Arguments parser expects command line arguments of the 'short' form
"-m ModeString" or the 'long' form "--mode=ModeString". It decodes this and
makes the ModeString available for access (via a method like -getModeArg).

Drone issues command line parameters of the form
<prefix><argname>=<argvalue>, where 'argname' presumably is the name of
some parameter or program instance variable in your application. My own app
parses and decodes the "<argname>=<argvalue>" part and uses probes to set
the values of the appropriate ivars. (The argname includes a reference to
the target object.)

So, if you do 'param setParamOption = " -D " ' (with a space after D) in
the Drone parameter file, the command line arguments will look like " -D
<argname>=<argvalue>". The subclassed version of Arguments decodes this and
makes the string "argname=argvalue" available for you. HOWEVER, if Drone
issues several such arguments on the command line, only the last one parsed
will be remembered by Arguments. So you need to parse the command line
yourself for Drone's arguments -- the value of this way of doing things is
just that Swarm's Arguments doesn't complain about -D being an unknown type
of argument.

If instead you do 'param setParamOption = " -D"' (no space after the D),
Drone will issue command line arguments of the form "
-D<argname>=<argvalue>". To decode this correctly, you need to make the
subclass of Arguments recognize each different possible " -D<argname>", and
it will then store (and make accessible) the 'argvalue'.

Whether you do it one way or the other, depends a lot on (a) whether you
already have an argument parser in your app; and (b) whether the number of
different arguments Drone might issue is large or small.

Cheers and good luck,
Sven


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]