From root@calvin.sfasu.EDU Tue Mar 17 05:20:18 1992 Received: from calvin.sfasu.edu by umaxc.weeg.uiowa.edu (5.61.jnf/920125) on Tue, 17 Mar 92 05:20:15 -0600 id AA07246 with SMTP Received: by calvin.sfasu.EDU (5.59/25-eef) id AA01161; Tue, 17 Mar 92 05:08:57 CST Return-Path: Message-Id: <9203171108.AA01161@calvin.sfasu.EDU> From: calvin!root@calvin.sfasu.EDU (B. Scott Mills) X-Mailer: SCO System V Mail (version 3.2) To: hyperc@calvin.sfasu.EDU Subject: Re: dir Date: Tue, 17 Mar 92 5:08:57 CST Status: R To: ST2975@SIUCVMB.SIU.EDU cc: hyperc-l@calvin.sfasu.edu Subject: Re: dir In-reply-to: Your message of "Wed, 04 Mar 92 22:48:32 CST." <9203050445.AA02280@calvin.sfasu.EDU> -------- Regarding getflags(), here's an example of how I've used it with sokoban (the shell version) main(argc, argv) int *argc; char *argv; { BOOL optrestore = optscore = 0; int optlevel = 1; ... getflags(&argc,&argv,"r,s,n#",&optrestore,&optscore,&optlevel); ... } What it does is scan for -r, -s, or -n (there need not be a space between n and for getflags to recognize n as the flag and as the argument. It will fill the boolean variables with a 1 if they are present and fill optlevel with the argument following -n. Sometimes it is more advantageous to use a homebrew flag checker, by just making a loop for argc and checking each argv, as is the case with a lf2cr converter I wrote, which has a command line like : lf2cr [-o ] [-l] [-s] getflags() only works (for me, at least) when you have a flag you want. It won't find a simple filename after the program name, unless it has a -flag for it. If that is hard to follow, I can probably confuse everyone more if they need more help, but feel free to ask! Evan