home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / hl10osrc.lzh / EditLibr / EditLibr.h < prev    next >
Text File  |  1994-04-23  |  2KB  |  54 lines

  1. // EditLibr.h - autogenerated from EditLibr.arg on Sat Apr 23 13:16:29 1994
  2. // Do not edit this file!  Re-run makeargprc to re-generate
  3.  
  4. #ifndef VERSION
  5. #define VERSION "V0.0"
  6. #endif
  7.  
  8. class EditLibr {
  9. public:
  10.              EditLibr(int argc,char** argv);
  11.         void Usage();
  12.         char* editfile; // The name of the file to edit
  13.         Boolean editfile_passed;
  14.         int minpages; // The minimum # of pages to set aside when creating a new file
  15.         Boolean minpages_passed;
  16. };
  17.  
  18. void EditLibr::Usage()
  19. {
  20.         cout << "Syntax: EditLibr [opts]\n";
  21.         cout << "Librarian Card Catalog file editor\n";
  22.         cout << "This program is used to edit and maintain Card Catalog Files\n";
  23.         cout << "Options:\n";
  24.         cout << "-editfile\tString Required The name of the file to edit\n";
  25.         cout << "-minpages\tInteger Optional The minimum # of pages to set aside when creating a new file\n";
  26.         cout << "\n\tVersion: " << VERSION << "\n";        cout << "\tCopyright (c) 1991,1992 Robert Heller D/B/A Deepwoods Software\n";}
  27.  
  28. EditLibr::EditLibr(int argc,char** argv)
  29. {
  30.         editfile_passed = false;
  31.         minpages_passed = false;
  32.         for (int iarg=1;iarg<argc;iarg++) {
  33.             if (strcmp(argv[iarg],"-?") == 0 ||
  34.                 strcmp(argv[iarg],"-U") == 0) {
  35.                 Usage(); exit(0);
  36.             } else if (strcmp(argv[iarg],"-editfile") == 0 && (iarg+1) < argc) {
  37.                 iarg++;
  38.                 editfile_passed = true;
  39.                 editfile = argv[iarg];
  40.             } else if (strcmp(argv[iarg],"-minpages") == 0 && (iarg+1) < argc) {
  41.                 iarg++;
  42.                 minpages_passed = true;
  43.                 minpages = atoi(argv[iarg]);
  44.             } else {
  45.                 cerr << "Bad option: " << argv[iarg] << "\n";
  46.                 Usage(); exit(1);
  47.             }
  48.         }
  49.         if (!editfile_passed) {
  50.             cerr << "Missing parameter: editfile\n";
  51.                 Usage(); exit(1);
  52.         }
  53. }
  54.