]> git.sesse.net Git - vlc/commitdiff
* src/libvlc.c,h: new --help-verbose option that activates printing of longtext descr...
authorGildas Bazin <gbazin@videolan.org>
Thu, 10 Feb 2005 14:45:34 +0000 (14:45 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 10 Feb 2005 14:45:34 +0000 (14:45 +0000)
src/libvlc.c
src/libvlc.h

index 19f0abe70890773144b5a15b190b496a2925bddd..2f76b55549a7ed3908b8595e156cc8164140091e 100644 (file)
@@ -1861,16 +1861,20 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
     vlc_list_t *p_list;
     module_t *p_parser;
     module_config_t *p_item;
-    char psz_spaces[PADDING_SPACES+LINE_START+1];
+    char psz_spaces_text[PADDING_SPACES+LINE_START+1];
+    char psz_spaces_longtext[LINE_START+3];
     char psz_format[sizeof(FORMAT_STRING)];
-    char psz_buffer[1000];
+    char psz_buffer[10000];
     char psz_short[4];
     int i_index;
     int i_width = ConsoleWidth() - (PADDING_SPACES+LINE_START+1);
     vlc_bool_t b_advanced = config_GetInt( p_this, "advanced" );
+    vlc_bool_t b_description;
 
-    memset( psz_spaces, ' ', PADDING_SPACES+LINE_START );
-    psz_spaces[PADDING_SPACES+LINE_START] = '\0';
+    memset( psz_spaces_text, ' ', PADDING_SPACES+LINE_START );
+    psz_spaces_text[PADDING_SPACES+LINE_START] = '\0';
+    memset( psz_spaces_longtext, ' ', LINE_START+2 );
+    psz_spaces_longtext[LINE_START+2] = '\0';
 
     strcpy( psz_format, FORMAT_STRING );
 
@@ -1924,7 +1928,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
              p_item->i_type != CONFIG_HINT_END;
              p_item++ )
         {
-            char *psz_text;
+            char *psz_text, *psz_spaces = psz_spaces_text;
             char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL;
             char *psz_suf = "", *psz_prefix = NULL;
             int i;
@@ -2053,6 +2057,9 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
 
             /* We wrap the rest of the output */
             sprintf( psz_buffer, "%s%s", p_item->psz_text, psz_suf );
+            b_description = config_GetInt( p_this, "help-verbose" );
+
+ description:
             psz_text = psz_buffer;
             while( *psz_text )
             {
@@ -2101,6 +2108,15 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
                     psz_text = psz_word;
                 }
             }
+
+            if( b_description && p_item->psz_longtext )
+            {
+                sprintf( psz_buffer, "%s%s", p_item->psz_longtext, psz_suf );
+                b_description = VLC_FALSE;
+                psz_spaces = psz_spaces_longtext;
+                fprintf( stdout, "%s", psz_spaces );
+                goto description;
+            }
         }
     }
 
index 8e7242fa714c52e4d0f6ac42f7ad5db5a79f0f1b..5d50f182a84fe418197b0eb7c861cbe46d4db4fe 100644 (file)
@@ -1499,6 +1499,8 @@ static module_config_t p_help_config[] =
       N_("print help (can be combined with --advanced)") },
     { CONFIG_ITEM_BOOL, NULL, "longhelp", 'H',
       N_("print detailed help (can be combined with --advanced)") },
+    { CONFIG_ITEM_BOOL, NULL, "help-verbose", '\0',
+      N_("ask for extra verbosity when displaying help") },
     { CONFIG_ITEM_BOOL, NULL, "list", 'l',
       N_("print a list of available modules") },
     { CONFIG_ITEM_STRING, NULL, "module", 'p',