home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_06 / 9n06076a < prev    next >
Text File  |  1990-03-01  |  455b  |  19 lines

  1.  
  2. Listing 1:  Traditional getopt(3) Command Line Processing
  3. =========================================================
  4.  
  5. while ((option = getopt (argc, argv, optstring)) != -1) {
  6.     switch (option) {
  7.     case 'a': ... ;  break ;    /* Options */
  8.     case 'b': ... ;  break ;
  9.     ...
  10.     case '?': ... error ...
  11.     default:  break ;
  12.     }
  13. }
  14. while (optind < argc) {         /* Non-option arguments */
  15.     ... process argv[optind++] ...
  16. }
  17.  
  18.  
  19.