Changeset a5279ce in git
- Timestamp:
- May 20, 1998, 4:54:47 PM (25 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 651b4646ed535e81739179b38258acc14067c72b
- Parents:
- d3716c0b0f03464f78fa19dc4dbb72c2bfc79cb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/utils.cc
rd3716c ra5279ce 11 11 extern int found_version, found_info, found_oldhelp, found_proc_in_proc; 12 12 warning_info = 0, warning_version = 0; 13 14 static 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 13 26 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 14 27 void main_init(int argc, char *argv[]) … … 16 29 char c, *file=NULL; 17 30 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 } 35 52 } 36 53 if(file!=NULL) { … … 43 60 else optind++; 44 61 } 62 } 63 if(yylpin == NULL) { 64 printf("No library found to parse.\n"); 65 usage(argv[0]); 45 66 } 46 67 }
Note: See TracChangeset
for help on using the changeset viewer.