changeset 795:926e3900119c

Add -d option to viewmod.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 18 Oct 2013 19:40:44 +0300
parents 319792b2af4a
children 97ecc0a9c21f
files tools/viewmod.c
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tools/viewmod.c	Fri Oct 18 14:38:59 2013 +0300
+++ b/tools/viewmod.c	Fri Oct 18 19:40:44 2013 +0300
@@ -17,7 +17,8 @@
 BOOL    optViewPatterns = FALSE,
         optViewInstruments = FALSE,
         optViewExtInstruments = FALSE,
-        optViewGeneralInfo = FALSE;
+        optViewGeneralInfo = FALSE,
+        optDump = FALSE;
 
 
 DMOptArg optList[] =
@@ -28,6 +29,7 @@
     { 5, 'e', "extinstruments", "View extended instruments", OPT_NONE },
     { 3, 'g', "general", "General information", OPT_NONE },
     { 4, 'v', "verbose", "Be more verbose", OPT_NONE },
+    { 6, 'd', "dump", "Dump mode", OPT_NONE },
 };
 
 const int optListN = sizeof(optList) / sizeof(optList[0]);
@@ -71,6 +73,10 @@
             optViewExtInstruments = TRUE;
             break;
 
+        case 6:
+            optDump = TRUE;
+            break;
+
         default:
             dmError("Unknown argument '%s'.\n", currArg);
             return FALSE;
@@ -234,7 +240,7 @@
     }
 
 #ifndef JSS_LIGHT
-    if (i->desc)
+    if (i->desc && !optDump)
         fprintf(f,
         "Description: '%s'\n", i->desc);
 #endif
@@ -268,7 +274,7 @@
     if (dmVerbosity >= 1)
     {
 #ifndef JSS_LIGHT
-        if (i->desc)
+        if (i->desc && !optDump)
             fprintf(f, "Description: '%s'\n", i->desc);
 #endif
         fprintf(f,
@@ -299,7 +305,7 @@
     else
     {
 #ifndef JSS_LIGHT
-        if (i->desc)
+        if (i->desc && !optDump)
             fprintf(f, "'%s', ", i->desc);
 #endif
         fprintf(f,
@@ -323,6 +329,8 @@
     if (!m)
         return;
 
+    if (!optDump)
+    {
     fprintf(f, "Module type.....: %i\n", m->moduleType);
 #ifndef JSS_LIGHT
     if (m->moduleName)
@@ -330,6 +338,7 @@
     if (m->trackerName)
         fprintf(f, "Tracker name....: '%s'\n", m->trackerName);
 #endif
+    }
     fprintf(f,
         "Speed...........: %d ticks\n"
         "Tempo...........: %d bpm\n"