Changeset a5279ce in git


Ignore:
Timestamp:
May 20, 1998, 4:54:47 PM (25 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
651b4646ed535e81739179b38258acc14067c72b
Parents:
d3716c0b0f03464f78fa19dc4dbb72c2bfc79cb9
Message:
added help for libparse


git-svn-id: file:///usr/local/Singular/svn/trunk@1951 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/utils.cc

    rd3716c ra5279ce  
    1111extern int found_version, found_info, found_oldhelp, found_proc_in_proc;
    1212warning_info = 0, warning_version = 0;
     13
     14static usage(char *progname)
     15{
     16  printf("libparse: a syntax-checker for Singular Libraries.\n");
     17  printf("USAGE: %s [options] singular-library\n", progname);
     18  printf("Options:\n");
     19  printf("   -f <singular library> : checks\n");
     20  printf("   -d [digit]            : digit=1,..,4 increases the verbosity of the checks\n");
     21  printf("   -s                    : \n");
     22  printf("   -h                    : print this message\n");
     23  exit(1);
     24}
     25 
    1326/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
    1427void main_init(int argc, char *argv[])
     
    1629  char c, *file=NULL;
    1730
    18   while((c=getopt(argc, argv, "d:sf:"))>=0) {
    19     switch(c)
    20       {
    21       case 'd':
    22         lpverbose = 1;
    23         if(isdigit(argv[optind-1][0])) sscanf(optarg, "%d", &lpverbose);
    24         else optind--;
    25         break;
    26       case 'f': file = argv[optind-1];
    27         break;
    28       case 's':
    29         check++;
    30         break;
    31       case -1 : printf("no such option:%s\n", argv[optind]);
    32         break;
    33       default: printf("no such option.%x, %c %s\n", c&0xff, c, argv[optind]);
    34       }
     31  while((c=getopt(argc, argv, "hd:sf:"))>=0) {
     32    switch(c) {
     33        case 'd':
     34          lpverbose = 1;
     35          if(isdigit(argv[optind-1][0])) sscanf(optarg, "%d", &lpverbose);
     36          else optind--;
     37          break;
     38        case 'f': file = argv[optind-1];
     39          break;
     40        case 's':
     41          check++;
     42          break;
     43        case 'h' :
     44          usage(argv[0]);
     45          break;
     46        case -1 : printf("no such option:%s\n", argv[optind]);
     47          usage(argv[0]);
     48          break;
     49        default: printf("no such option.%x, %c %s\n", c&0xff, c, argv[optind]);
     50          usage(argv[0]);
     51    }
    3552  }
    3653  if(file!=NULL) {
     
    4360      else optind++;
    4461    }
     62  }
     63  if(yylpin == NULL) {
     64    printf("No library found to parse.\n");
     65    usage(argv[0]);
    4566  }
    4667}
Note: See TracChangeset for help on using the changeset viewer.