src/c2html.c

changeset 37
1a67185e5496
parent 36
be60c22cddfe
child 38
77c158821738
     1.1 --- a/src/c2html.c	Fri Mar 04 15:02:22 2016 +0100
     1.2 +++ b/src/c2html.c	Tue Aug 23 12:05:41 2016 +0200
     1.3 @@ -111,9 +111,8 @@
     1.4          "  -F <footer>           Append footer file\n"
     1.5          "  -p                    Disable highlighting (plain text)\n"
     1.6          "  -l                    Disable line numbers\n"
     1.7 +        "  -V, -v                Prints version and exits\n"
     1.8          "\n");
     1.9 -
    1.10 -
    1.11  }
    1.12  
    1.13  int lnint(size_t lnc) {
    1.14 @@ -221,7 +220,7 @@
    1.15      int lang = C2HTML_C;
    1.16  
    1.17      char optc;
    1.18 -    while ((optc = getopt(argc, argv, "hljo:pH:F:")) != -1) {
    1.19 +    while ((optc = getopt(argc, argv, "hljo:pH:F:vV")) != -1) {
    1.20          switch (optc) {
    1.21              case 'o':
    1.22                  if (!(optarg[0] == '-' && optarg[1] == 0)) {
    1.23 @@ -246,6 +245,14 @@
    1.24              case 'h':
    1.25                  printhelp();
    1.26                  return 0;
    1.27 +            case 'v':
    1.28 +            case 'V':
    1.29 +#ifdef VERSION_DEVELOP
    1.30 +                printf("%d.%d (unstable)\n", VERSION_MAJOR, VERSION_MINOR);
    1.31 +#else
    1.32 +                printf("%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
    1.33 +#endif
    1.34 +                return 0;
    1.35              default:
    1.36                  return 1;
    1.37          }

mercurial