home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_07 / 8n07044a < prev    next >
Text File  |  1990-06-19  |  677b  |  28 lines

  1. ------------------------------------------------------
  2. LISTING 1
  3.  
  4.  
  5. /*        TestOpt.c
  6. */
  7. #include <stdio.h>
  8. #include "Options.h"
  9.     void
  10. main( int argc, char **argv){
  11.         Options opt;
  12.         char *s;
  13.     PutArgs( (opt=CreateOptions()), argc, argv);
  14.     printf( "-x switch is %s.\n", 
  15.             IsSwitch( opt, 'x' )?"ON":"OFF");
  16.     if( (s=GetParameter(opt,'f')) != NULL )
  17.         printf(" -f parameter:  '%s'.\n", s);
  18.     else    printf(" -f parameter omitted.\n");
  19.     if( IsMoreSwitches(opt) )
  20.         printf("Unrecognized switch character.\n");
  21.     printf( "The command line arguements are:  ");
  22.     while( (s=GetNextOption(opt)) != NULL )
  23.         printf( "\t%s", s);
  24.     printf(".\n");
  25.     DestroyOptions(opt);
  26.     }
  27.  
  28.