src/c2html.c

changeset 37
1a67185e5496
parent 36
be60c22cddfe
child 38
77c158821738
equal deleted inserted replaced
36:be60c22cddfe 37:1a67185e5496
109 " -o <output> Output file (stdout, if not specified)\n" 109 " -o <output> Output file (stdout, if not specified)\n"
110 " -H <header> Prepend header file\n" 110 " -H <header> Prepend header file\n"
111 " -F <footer> Append footer file\n" 111 " -F <footer> Append footer file\n"
112 " -p Disable highlighting (plain text)\n" 112 " -p Disable highlighting (plain text)\n"
113 " -l Disable line numbers\n" 113 " -l Disable line numbers\n"
114 " -V, -v Prints version and exits\n"
114 "\n"); 115 "\n");
115
116
117 } 116 }
118 117
119 int lnint(size_t lnc) { 118 int lnint(size_t lnc) {
120 int w = 1, p = 1; 119 int w = 1, p = 1;
121 while ((p*=10) < lnc) w++; 120 while ((p*=10) < lnc) w++;
219 settings.showlinenumbers = 1; 218 settings.showlinenumbers = 1;
220 219
221 int lang = C2HTML_C; 220 int lang = C2HTML_C;
222 221
223 char optc; 222 char optc;
224 while ((optc = getopt(argc, argv, "hljo:pH:F:")) != -1) { 223 while ((optc = getopt(argc, argv, "hljo:pH:F:vV")) != -1) {
225 switch (optc) { 224 switch (optc) {
226 case 'o': 225 case 'o':
227 if (!(optarg[0] == '-' && optarg[1] == 0)) { 226 if (!(optarg[0] == '-' && optarg[1] == 0)) {
228 settings.outfilename = optarg; 227 settings.outfilename = optarg;
229 } 228 }
243 case 'l': 242 case 'l':
244 settings.showlinenumbers = 0; 243 settings.showlinenumbers = 0;
245 break; 244 break;
246 case 'h': 245 case 'h':
247 printhelp(); 246 printhelp();
247 return 0;
248 case 'v':
249 case 'V':
250 #ifdef VERSION_DEVELOP
251 printf("%d.%d (unstable)\n", VERSION_MAJOR, VERSION_MINOR);
252 #else
253 printf("%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
254 #endif
248 return 0; 255 return 0;
249 default: 256 default:
250 return 1; 257 return 1;
251 } 258 }
252 } 259 }

mercurial