Commit 17ce2b17 authored by Gildas Bazin's avatar Gildas Bazin

* src/libvlc.c,h: new --help-verbose option that activates printing of...

* src/libvlc.c,h: new --help-verbose option that activates printing of longtext descriptions for config options.
parent aadabf1c
...@@ -1861,16 +1861,20 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -1861,16 +1861,20 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
vlc_list_t *p_list; vlc_list_t *p_list;
module_t *p_parser; module_t *p_parser;
module_config_t *p_item; 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_format[sizeof(FORMAT_STRING)];
char psz_buffer[1000]; char psz_buffer[10000];
char psz_short[4]; char psz_short[4];
int i_index; int i_index;
int i_width = ConsoleWidth() - (PADDING_SPACES+LINE_START+1); int i_width = ConsoleWidth() - (PADDING_SPACES+LINE_START+1);
vlc_bool_t b_advanced = config_GetInt( p_this, "advanced" ); vlc_bool_t b_advanced = config_GetInt( p_this, "advanced" );
vlc_bool_t b_description;
memset( psz_spaces, ' ', PADDING_SPACES+LINE_START ); memset( psz_spaces_text, ' ', PADDING_SPACES+LINE_START );
psz_spaces[PADDING_SPACES+LINE_START] = '\0'; 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 ); strcpy( psz_format, FORMAT_STRING );
...@@ -1924,7 +1928,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -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->i_type != CONFIG_HINT_END;
p_item++ ) 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_bra = NULL, *psz_type = NULL, *psz_ket = NULL;
char *psz_suf = "", *psz_prefix = NULL; char *psz_suf = "", *psz_prefix = NULL;
int i; int i;
...@@ -2053,6 +2057,9 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -2053,6 +2057,9 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
/* We wrap the rest of the output */ /* We wrap the rest of the output */
sprintf( psz_buffer, "%s%s", p_item->psz_text, psz_suf ); sprintf( psz_buffer, "%s%s", p_item->psz_text, psz_suf );
b_description = config_GetInt( p_this, "help-verbose" );
description:
psz_text = psz_buffer; psz_text = psz_buffer;
while( *psz_text ) while( *psz_text )
{ {
...@@ -2101,6 +2108,15 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -2101,6 +2108,15 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
psz_text = psz_word; 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;
}
} }
} }
......
...@@ -1499,6 +1499,8 @@ static module_config_t p_help_config[] = ...@@ -1499,6 +1499,8 @@ static module_config_t p_help_config[] =
N_("print help (can be combined with --advanced)") }, N_("print help (can be combined with --advanced)") },
{ CONFIG_ITEM_BOOL, NULL, "longhelp", 'H', { CONFIG_ITEM_BOOL, NULL, "longhelp", 'H',
N_("print detailed help (can be combined with --advanced)") }, 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', { CONFIG_ITEM_BOOL, NULL, "list", 'l',
N_("print a list of available modules") }, N_("print a list of available modules") },
{ CONFIG_ITEM_STRING, NULL, "module", 'p', { CONFIG_ITEM_STRING, NULL, "module", 'p',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment