home *** CD-ROM | disk | FTP | other *** search
- #include "exec/types.h"
- extern int Flgs[26];
-
- extern int Enable_Abort; /* Flgs[2] (-c) will set to non zero */
- /* to enable checks for abort */
- Do_Arguments(count,strings)
- int count;
- char *strings[];
- {
- register int loop;
- register char *ptr;
- int c;
-
- if ( count == 2 && *strings[1] == '?' )
- {
- printf(" Usage is: %s [-option ... -option]\n",strings[0]);
- }
- else
- {
- for(loop=0; loop < 26; loop++) Flgs[loop] = FALSE;
- while ( --count > 0 )
- {
- ptr = *++strings;
- if ( *ptr++ == '-' )
- {
- c = toupper(*ptr) - 'A' ; /* get an index 0 to 25 */
- if ( c >= 0 && c <= 25 )
- {
- Flgs[c] = TRUE;
- }
- else
- {
- printf(" %s has an invalid option: %s\n",strings[0],ptr);
- };
- };
- };
- };
- if( Flgs[3] ) /* if -d requested show selected options */
- for ( c = 0; c < 26; c++)
- if ( Flgs[c] ) printf(" Option %d is on\n",c);
- if( Flgs[2] )
- {
- Enable_Abort = 0; /* no abort on control-c unless user does it */
- }
- else
- {
- Enable_Abort = 1; /* abort on control-c */
- };
- }
-