Browse Source

Add flags to increase and decrease verbosity level and set default

verbosity to TRC_WARN.
Bernhard Fröhlich 4 years ago
parent
commit
9592a69d27
3 changed files with 26 additions and 6 deletions
  1. 8
    3
      README.md
  2. 17
    2
      drmdecrypt.c
  3. 1
    1
      trace.h

+ 8
- 3
README.md View File

@@ -21,7 +21,13 @@ This version is fast, POSIX compliant (Linux, FreeBSD, Windows
21 21
 ## Usage
22 22
 
23 23
 ```
24
-drmdecrypt [-x] [-o outdir] infile.srf
24
+Usage: drmdecrypt [-dqvx][-o outdir] infile.srf ...
25
+Options:
26
+   -d         Show debugging output
27
+   -o outdir  Output directory
28
+   -q         Be quiet. Only error output.
29
+   -v         Version information
30
+   -x         Disable AES-NI support
25 31
 ```
26 32
 
27 33
 
@@ -35,6 +41,5 @@ make install
35 41
 
36 42
 ## TODO
37 43
 
38
-- flag to specify verbosity level
39
-- MPEG packet size could also be 204 or 208 byte
44
+- Test with Samsung Series D, E, F
40 45
 

+ 17
- 2
drmdecrypt.c View File

@@ -393,7 +393,14 @@ resync:
393 393
 
394 394
 void usage(void)
395 395
 {
396
-   fprintf(stderr, "Usage: drmdecrypt [-x] [-o outdir] infile.srf ...\n");
396
+   fprintf(stderr, "Usage: drmdecrypt [-dqvx][-o outdir] infile.srf ...\n");
397
+   fprintf(stderr, "Options:\n");
398
+   fprintf(stderr, "   -d         Show debugging output\n");
399
+   fprintf(stderr, "   -o outdir  Output directory\n");
400
+   fprintf(stderr, "   -q         Be quiet. Only error output.\n");
401
+   fprintf(stderr, "   -v         Version information\n");
402
+   fprintf(stderr, "   -x         Disable AES-NI support\n");
403
+   fprintf(stderr, "\n");
397 404
 }
398 405
 
399 406
 int main(int argc, char *argv[])
@@ -405,13 +412,21 @@ int main(int argc, char *argv[])
405 412
 
406 413
    enable_aesni = Check_CPU_support_AES();
407 414
 
408
-   while ((ch = getopt(argc, argv, "o:vx")) != -1)
415
+   while ((ch = getopt(argc, argv, "do:qvx")) != -1)
409 416
    {
410 417
       switch (ch)
411 418
       {
419
+         case 'd':
420
+            if(tracelevel > TRC_DEBUG)
421
+               tracelevel--;
422
+            break;
412 423
          case 'o':
413 424
             strcpy(outdir, optarg);
414 425
             break;
426
+         case 'q':
427
+            if(tracelevel < TRC_ERROR)
428
+               tracelevel++;
429
+            break;
415 430
          case 'v':
416 431
             fprintf(stderr, "drmdecrypt %s (%s)\n\n", VERSION, STR(REVISION));
417 432
             fprintf(stderr, "Source: http://github.com/decke/drmdecrypt\n");

+ 1
- 1
trace.h View File

@@ -14,7 +14,7 @@ enum {
14 14
    TRC_ERROR
15 15
 };
16 16
 
17
-static int tracelevel = TRC_INFO;
17
+static int tracelevel = TRC_WARN;
18 18
 
19 19
 #define trace(L, M, ...) \
20 20
    if(L >= tracelevel) { \

Loading…
Cancel
Save