Commit caad089789c471c37416301f593f1ece04490a23

Authored by Jay Berkenbilt
1 parent 07dc5921

-help and -version

git-svn-id: svn+q:///qpdf/trunk@643 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing 2 changed files with 11 additions and 2 deletions
ChangeLog
  1 +2008-12-11 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * qpdf/qpdf.cc (main): Accept -help and -version as well as --help
  4 + and --version
  5 +
1 2008-11-23 Jay Berkenbilt <ejb@ql.org> 6 2008-11-23 Jay Berkenbilt <ejb@ql.org>
2 7
3 * Include stdio.h in a few files for proper compilation with (yet 8 * Include stdio.h in a few files for proper compilation with (yet
qpdf/qpdf.cc
@@ -436,7 +436,9 @@ int main(int argc, char* argv[]) @@ -436,7 +436,9 @@ int main(int argc, char* argv[])
436 whoami += 3; 436 whoami += 3;
437 } 437 }
438 438
439 - if ((argc == 2) && (strcmp(argv[1], "--version") == 0)) 439 + if ((argc == 2) &&
  440 + ((strcmp(argv[1], "--version") == 0) ||
  441 + (strcmp(argv[1], "-version") == 0)))
440 { 442 {
441 // make_dist looks for the line of code here that actually 443 // make_dist looks for the line of code here that actually
442 // prints the version number, so read make_dist if you change 444 // prints the version number, so read make_dist if you change
@@ -459,7 +461,9 @@ int main(int argc, char* argv[]) @@ -459,7 +461,9 @@ int main(int argc, char* argv[])
459 exit(0); 461 exit(0);
460 } 462 }
461 463
462 - if ((argc == 2) && (strcmp(argv[1], "--help") == 0)) 464 + if ((argc == 2) &&
  465 + ((strcmp(argv[1], "--help") == 0) ||
  466 + (strcmp(argv[1], "-help") == 0)))
463 { 467 {
464 std::cout << help; 468 std::cout << help;
465 exit(0); 469 exit(0);