Browse Source

Add version information and -v flag

tags/v1.0
Bernhard Fröhlich 5 years ago
parent
commit
6525f6883a
1 changed files with 15 additions and 1 deletions
  1. 15
    1
      drmdecrypt.c

+ 15
- 1
drmdecrypt.c View File

@@ -18,6 +18,15 @@
18 18
 #include "aes.h"
19 19
 #include "trace.h"
20 20
 
21
+/* Helper macros */
22
+#define STR_HELPER(x) #x
23
+#define STR(x) STR_HELPER(x)
24
+
25
+/* Version Information */
26
+#ifndef REVISION
27
+#define REVISION  ""
28
+#endif
29
+#define VERSION	  "0.9-git" STR(REVISION)
21 30
 
22 31
 block_state state;
23 32
 int enable_aesni = 0;
@@ -396,13 +405,18 @@ int main(int argc, char *argv[])
396 405
 
397 406
    enable_aesni = Check_CPU_support_AES();
398 407
 
399
-   while ((ch = getopt(argc, argv, "o:x")) != -1)
408
+   while ((ch = getopt(argc, argv, "o:vx")) != -1)
400 409
    {
401 410
       switch (ch)
402 411
       {
403 412
          case 'o':
404 413
             strcpy(outdir, optarg);
405 414
             break;
415
+         case 'v':
416
+            fprintf(stderr, "drmdecrypt %s\n\n", VERSION);
417
+            fprintf(stderr, "Source: http://github.com/decke/drmdecrypt\n");
418
+            fprintf(stderr, "License: GNU General Public License\n");
419
+            exit(EXIT_SUCCESS);
406 420
          case 'x':
407 421
             enable_aesni = 0;
408 422
             break;

Loading…
Cancel
Save