swarm-support
[Top][All Lists]
Advanced

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

SOLVED: Drone and Swarm-1.3


From: Sven N. Thommesen
Subject: SOLVED: Drone and Swarm-1.3
Date: Thu, 27 Aug 1998 09:58:52 -0500

I have discovered a way to make Drone work with Swarm-1.2 and -1.3.

(The problem was: Drone issues command line arguments of the sort 
"-Dargument=value", or in my case " -D:argument=value". 
An unmodified Swarm app will abort with an error message from the Arguments
object that -D is an invalid argument.)

If you have only a small number of arguments that Drone will ever issue,
you can use Arguments as intended by following Marcus's documentation. The
solution here assumes your app has a large number of parameters that may be
set by Drone, and that your app already has code to parse those arguments.

The following steps must be taken:

a. subclass Arguments as outlined in the refbook.
b. in MySwarmAppArguments.h, add a new ivar : const char *(droneArg).
c. in MySwarmAppArguments.m, add a method to getDroneArg.
d. in MySwarmAppArguments.m, add to the list of arg definitions:
     {"drone-param",'D',"PARAM",0,"Parameter from Drone",6},
e. in your Drone parameter file, specify
     param setParamOption = " -D "  // (notice the SPACE after D)
f. also in the drone parameter file, specify any other parameter options
   to have a space after 'D' (may need to surround the option with
doublequotes).

Your app will now no longer croak when encountering the command line
arguments set by Drone. This works ONLY because the Arguments parser
happily accepts having the same argument used multiple times; the last case
seen is what gets stored internally.

Of course, the Drone arguments aren't really the 'same' argument repeated
-- they just look like that to the parser. You now need to parse those
arguments yourself.

Assuming your app already has code to parse arguments from Drone, you get
access to the (unchanged) list of command line arguments with the calls
[arguments getArgc] and [arguments getArgv].


---> MARCUS: I have uploaded to /pub/swarm/users-contrib/incoming a version
of heatbugs modified along the lines described above, for the curious to
look at. Perhaps you could move it over to /anarchy ? Tks.

Cheers,
Sven Thommesen


                  ==================================
   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]