Commit 25a0dbbb authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* More descriptions of the VLC commandline syntax when running --help.

* Added --advanced to the "Help Options" as well. It's "duplicate", but it's easier to find now for cli users.
* Restored some add_category_hint so the cli help shows the proper categories again.
parent adf5a2dd
...@@ -93,6 +93,7 @@ static vlc_t * p_static_vlc; ...@@ -93,6 +93,7 @@ static vlc_t * p_static_vlc;
*****************************************************************************/ *****************************************************************************/
static void SetLanguage ( char const * ); static void SetLanguage ( char const * );
static int GetFilenames ( vlc_t *, int, char *[] ); static int GetFilenames ( vlc_t *, int, char *[] );
static void Help ( vlc_t *, char const *psz_help_name );
static void Usage ( vlc_t *, char const *psz_module_name ); static void Usage ( vlc_t *, char const *psz_module_name );
static void ListModules ( vlc_t * ); static void ListModules ( vlc_t * );
static void Version ( void ); static void Version ( void );
...@@ -318,10 +319,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -318,10 +319,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
/* Check for short help option */ /* Check for short help option */
if( config_GetInt( p_vlc, "help" ) ) if( config_GetInt( p_vlc, "help" ) )
{ {
fprintf( stdout, _("Usage: %s [options] [items]...\n"), Help( p_vlc, "help" );
p_vlc->psz_object_name );
Usage( p_vlc, "main" );
Usage( p_vlc, "help" );
b_exit = VLC_TRUE; b_exit = VLC_TRUE;
} }
/* Check for version option */ /* Check for version option */
...@@ -457,14 +455,14 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -457,14 +455,14 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
/* Check for help on modules */ /* Check for help on modules */
if( (p_tmp = config_GetPsz( p_vlc, "module" )) ) if( (p_tmp = config_GetPsz( p_vlc, "module" )) )
{ {
Usage( p_vlc, p_tmp ); Help( p_vlc, p_tmp );
free( p_tmp ); free( p_tmp );
b_exit = VLC_TRUE; b_exit = VLC_TRUE;
} }
/* Check for long help option */ /* Check for long help option */
else if( config_GetInt( p_vlc, "longhelp" ) ) else if( config_GetInt( p_vlc, "longhelp" ) )
{ {
Usage( p_vlc, NULL ); Help( p_vlc, "longhelp" );
b_exit = VLC_TRUE; b_exit = VLC_TRUE;
} }
/* Check for module list option */ /* Check for module list option */
...@@ -1842,7 +1840,39 @@ static int GetFilenames( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] ) ...@@ -1842,7 +1840,39 @@ static int GetFilenames( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
} }
/***************************************************************************** /*****************************************************************************
* Usage: print program usage * Help: print program help
*****************************************************************************
* Print a short inline help. Message interface is initialized at this stage.
*****************************************************************************/
static void Help( vlc_t *p_this, char const *psz_help_name )
{
#ifdef WIN32
ShowConsole();
#endif
if( psz_help_name && !strcmp( psz_help_name, "help" ) )
{
fprintf( stdout, VLC_USAGE, p_this->psz_object_name );
Usage( p_this, "help" );
Usage( p_this, "main" );
}
else if( psz_help_name && !strcmp( psz_help_name, "longhelp" ) )
{
fprintf( stdout, VLC_USAGE, p_this->psz_object_name );
Usage( p_this, NULL );
}
else if( psz_help_name )
{
Usage( p_this, psz_help_name );
}
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
PauseConsole();
#endif
}
/*****************************************************************************
* Usage: print module usage
***************************************************************************** *****************************************************************************
* Print a short inline help. Message interface is initialized at this stage. * Print a short inline help. Message interface is initialized at this stage.
*****************************************************************************/ *****************************************************************************/
...@@ -1882,10 +1912,6 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -1882,10 +1912,6 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
strcpy( psz_format, FORMAT_STRING ); strcpy( psz_format, FORMAT_STRING );
#ifdef WIN32
ShowConsole();
#endif
/* List all modules */ /* List all modules */
p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
...@@ -2126,10 +2152,6 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -2126,10 +2152,6 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
/* Release the module list */ /* Release the module list */
vlc_list_release( p_list ); vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
PauseConsole();
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -2151,12 +2173,6 @@ static void ListModules( vlc_t *p_this ) ...@@ -2151,12 +2173,6 @@ static void ListModules( vlc_t *p_this )
ShowConsole(); ShowConsole();
#endif #endif
/* Usage */
fprintf( stdout, _("Usage: %s [options] [items]...\n\n"),
p_this->p_vlc->psz_object_name );
fprintf( stdout, _("[module] [description]\n") );
/* List all modules */ /* List all modules */
p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
......
...@@ -832,11 +832,25 @@ static char *ppsz_clock_descriptions[] = ...@@ -832,11 +832,25 @@ static char *ppsz_clock_descriptions[] =
#define SNAP_KEY_TEXT N_("Take video snapshot") #define SNAP_KEY_TEXT N_("Take video snapshot")
#define SNAP_KEY_LONGTEXT N_("Takes a video snapshot and writes it to disk.") #define SNAP_KEY_LONGTEXT N_("Takes a video snapshot and writes it to disk.")
#define PLAYLIST_USAGE N_( \ #define VLC_USAGE N_( \
"\nPlaylist MRL syntax:" \ "Usage: %s [options] [playlistitems] ..." \
"\n URL[@[title][:chapter][-[title][:chapter]]] [:option=value]" \ "\nYou can specify multiple playlistitems on the commandline. They will be enqueued in the playlist." \
"\nThe first item specified will be played first." \
"\n" \
"\nOptions-styles:" \
"\n --option A global option that is set for the duration of the program." \
"\n -option A single letter version of a global --option." \
"\n :option An option that only applies to the playlistitem directly before it" \
"\n and that overrides previous settings." \
"\n" \
"\nPlaylistitem MRL syntax:" \
"\n URL[@[title][:chapter][-[title][:chapter]]] [:option=value ...]" \
"\n" \
"\n Many of the global --options can also be used as MRL specific :options." \
"\n Multiple :option=value pairs can be specified." \
"\n" \
"\nURL syntax:" \ "\nURL syntax:" \
"\n [file://]filename plain media file" \ "\n [file://]filename Plain media file" \
"\n http://ip:port/file HTTP URL" \ "\n http://ip:port/file HTTP URL" \
"\n ftp://ip:port/file FTP URL" \ "\n ftp://ip:port/file FTP URL" \
"\n mms://ip:port/file MMS URL" \ "\n mms://ip:port/file MMS URL" \
...@@ -846,8 +860,8 @@ static char *ppsz_clock_descriptions[] = ...@@ -846,8 +860,8 @@ static char *ppsz_clock_descriptions[] =
"\n [cdda://][device] Audio CD device" \ "\n [cdda://][device] Audio CD device" \
"\n udp:[[<source address>]@[<bind address>][:<bind port>]]" \ "\n udp:[[<source address>]@[<bind address>][:<bind port>]]" \
"\n UDP stream sent by a streaming server"\ "\n UDP stream sent by a streaming server"\
"\n vlc:pause pause execution of playlist items" \ "\n vlc:pause Special item to pause the playlist" \
"\n vlc:quit quit VLC" \ "\n vlc:quit Special item to quit VLC" \
"\n") "\n")
...@@ -869,9 +883,11 @@ static char *ppsz_clock_descriptions[] = ...@@ -869,9 +883,11 @@ static char *ppsz_clock_descriptions[] =
*/ */
vlc_module_begin(); vlc_module_begin();
/* Audio options */ /* Audio options */
set_category( CAT_AUDIO ); set_category( CAT_AUDIO );
set_subcategory( SUBCAT_AUDIO_GENERAL ); set_subcategory( SUBCAT_AUDIO_GENERAL );
add_category_hint( N_("Audio"), AOUT_CAT_LONGTEXT , VLC_FALSE );
add_bool( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT, VLC_FALSE ); add_bool( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT, VLC_FALSE );
add_integer_with_range( "volume", AOUT_VOLUME_DEFAULT, AOUT_VOLUME_MIN, add_integer_with_range( "volume", AOUT_VOLUME_DEFAULT, AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX, NULL, VOLUME_TEXT, AOUT_VOLUME_MAX, NULL, VOLUME_TEXT,
...@@ -896,9 +912,11 @@ vlc_module_begin(); ...@@ -896,9 +912,11 @@ vlc_module_begin();
add_module( "audio-visual", "visualization",NULL, NULL,AUDIO_VISUAL_TEXT, add_module( "audio-visual", "visualization",NULL, NULL,AUDIO_VISUAL_TEXT,
AUDIO_VISUAL_LONGTEXT, VLC_FALSE ); AUDIO_VISUAL_LONGTEXT, VLC_FALSE );
/* Video options */ /* Video options */
set_category( CAT_VIDEO ); set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_GENERAL ); set_subcategory( SUBCAT_VIDEO_GENERAL );
add_category_hint( N_("Video"), VOUT_CAT_LONGTEXT , VLC_FALSE );
add_bool( "video", 1, NULL, VIDEO_TEXT, VIDEO_LONGTEXT, VLC_TRUE ); add_bool( "video", 1, NULL, VIDEO_TEXT, VIDEO_LONGTEXT, VLC_TRUE );
add_bool( "grayscale", 0, NULL, GRAYSCALE_TEXT, add_bool( "grayscale", 0, NULL, GRAYSCALE_TEXT,
GRAYSCALE_LONGTEXT, VLC_FALSE ); GRAYSCALE_LONGTEXT, VLC_FALSE );
...@@ -949,9 +967,10 @@ vlc_module_begin(); ...@@ -949,9 +967,10 @@ vlc_module_begin();
add_string( "pixel-ratio", "1", NULL, PIXEL_RATIO_TEXT, PIXEL_RATIO_TEXT ); add_string( "pixel-ratio", "1", NULL, PIXEL_RATIO_TEXT, PIXEL_RATIO_TEXT );
#endif #endif
/* Subpictures options */ /* Subpictures options */
set_subcategory( SUBCAT_VIDEO_SUBPIC ); set_subcategory( SUBCAT_VIDEO_SUBPIC );
set_section( N_("On Screen Display") , NULL ); set_section( N_("On Screen Display") , NULL );
add_category_hint( N_("Subpictures"), SUB_CAT_LONGTEXT , VLC_FALSE );
add_bool( "osd", 1, NULL, OSD_TEXT, OSD_LONGTEXT, VLC_FALSE ); add_bool( "osd", 1, NULL, OSD_TEXT, OSD_LONGTEXT, VLC_FALSE );
set_section( N_("Subtitles") , NULL ); set_section( N_("Subtitles") , NULL );
...@@ -975,9 +994,10 @@ vlc_module_begin(); ...@@ -975,9 +994,10 @@ vlc_module_begin();
add_module_list_cat( "sub-filter", SUBCAT_VIDEO_SUBPIC, NULL, NULL, add_module_list_cat( "sub-filter", SUBCAT_VIDEO_SUBPIC, NULL, NULL,
SUB_FILTER_TEXT, SUB_FILTER_LONGTEXT, VLC_TRUE ); SUB_FILTER_TEXT, SUB_FILTER_LONGTEXT, VLC_TRUE );
/* Input options */ /* Input options */
set_category( CAT_INPUT ); set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACCESS ); set_subcategory( SUBCAT_INPUT_ACCESS );
add_category_hint( N_("Input"), INPUT_CAT_LONGTEXT , VLC_FALSE );
add_module( "access", "access2", NULL, NULL, ACCESS_TEXT, add_module( "access", "access2", NULL, NULL, ACCESS_TEXT,
ACCESS_LONGTEXT, VLC_TRUE ); ACCESS_LONGTEXT, VLC_TRUE );
set_subcategory( SUBCAT_INPUT_DEMUX ); set_subcategory( SUBCAT_INPUT_DEMUX );
...@@ -1074,7 +1094,7 @@ vlc_module_begin(); ...@@ -1074,7 +1094,7 @@ vlc_module_begin();
CLOCK_SYNCHRO_LONGTEXT, VLC_FALSE ); CLOCK_SYNCHRO_LONGTEXT, VLC_FALSE );
change_integer_list( pi_clock_values, ppsz_clock_descriptions, 0 ); change_integer_list( pi_clock_values, ppsz_clock_descriptions, 0 );
/* Decoder options */ /* Decoder options */
add_category_hint( N_("Decoders"), CODEC_CAT_LONGTEXT , VLC_TRUE ); add_category_hint( N_("Decoders"), CODEC_CAT_LONGTEXT , VLC_TRUE );
add_string( "codec", NULL, NULL, CODEC_TEXT, add_string( "codec", NULL, NULL, CODEC_TEXT,
CODEC_LONGTEXT, VLC_TRUE ); CODEC_LONGTEXT, VLC_TRUE );
...@@ -1082,7 +1102,7 @@ vlc_module_begin(); ...@@ -1082,7 +1102,7 @@ vlc_module_begin();
ENCODER_LONGTEXT, VLC_TRUE ); ENCODER_LONGTEXT, VLC_TRUE );
/* Stream output options */ /* Stream output options */
set_category( CAT_SOUT ); set_category( CAT_SOUT );
set_subcategory( SUBCAT_SOUT_GENERAL ); set_subcategory( SUBCAT_SOUT_GENERAL );
add_category_hint( N_("Stream output"), SOUT_CAT_LONGTEXT , VLC_TRUE ); add_category_hint( N_("Stream output"), SOUT_CAT_LONGTEXT , VLC_TRUE );
...@@ -1118,9 +1138,10 @@ vlc_module_begin(); ...@@ -1118,9 +1138,10 @@ vlc_module_begin();
ANN_SAPINTV_LONGTEXT, VLC_TRUE ); ANN_SAPINTV_LONGTEXT, VLC_TRUE );
set_subcategory( SUBCAT_SOUT_VOD ); set_subcategory( SUBCAT_SOUT_VOD );
/* CPU options */ /* CPU options */
set_category( CAT_ADVANCED ); set_category( CAT_ADVANCED );
set_subcategory( SUBCAT_ADVANCED_CPU ); set_subcategory( SUBCAT_ADVANCED_CPU );
add_category_hint( N_("CPU"), CPU_CAT_LONGTEXT, VLC_TRUE );
#if defined( __i386__ ) #if defined( __i386__ )
add_bool( "mmx", 1, NULL, MMX_TEXT, MMX_LONGTEXT, VLC_TRUE ); add_bool( "mmx", 1, NULL, MMX_TEXT, MMX_LONGTEXT, VLC_TRUE );
add_bool( "3dn", 1, NULL, THREE_DN_TEXT, THREE_DN_LONGTEXT, VLC_TRUE ); add_bool( "3dn", 1, NULL, THREE_DN_TEXT, THREE_DN_LONGTEXT, VLC_TRUE );
...@@ -1131,9 +1152,11 @@ vlc_module_begin(); ...@@ -1131,9 +1152,11 @@ vlc_module_begin();
#if defined( __powerpc__ ) || defined( SYS_DARWIN ) #if defined( __powerpc__ ) || defined( SYS_DARWIN )
add_bool( "altivec", 1, NULL, ALTIVEC_TEXT, ALTIVEC_LONGTEXT, VLC_TRUE ); add_bool( "altivec", 1, NULL, ALTIVEC_TEXT, ALTIVEC_LONGTEXT, VLC_TRUE );
#endif #endif
/* Misc options */
/* Misc options */
set_subcategory( SUBCAT_ADVANCED_MISC ); set_subcategory( SUBCAT_ADVANCED_MISC );
set_section( N_("Special modules"), NULL ); set_section( N_("Special modules"), NULL );
add_category_hint( N_("Miscellaneous"), MISC_CAT_LONGTEXT, VLC_TRUE );
add_module( "memcpy", "memcpy", NULL, NULL, MEMCPY_TEXT, add_module( "memcpy", "memcpy", NULL, NULL, MEMCPY_TEXT,
MEMCPY_LONGTEXT, VLC_TRUE ); MEMCPY_LONGTEXT, VLC_TRUE );
add_module( "audio-channel-mixer", "audio mixer", NULL, NULL, add_module( "audio-channel-mixer", "audio mixer", NULL, NULL,
...@@ -1180,7 +1203,7 @@ vlc_module_begin(); ...@@ -1180,7 +1203,7 @@ vlc_module_begin();
change_short('d'); change_short('d');
#endif #endif
/* Playlist options */ /* Playlist options */
set_category( CAT_PLAYLIST ); set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_GENERAL ); set_subcategory( SUBCAT_PLAYLIST_GENERAL );
add_category_hint( N_("Playlist"), PLAYLIST_CAT_LONGTEXT , VLC_FALSE ); add_category_hint( N_("Playlist"), PLAYLIST_CAT_LONGTEXT , VLC_FALSE );
...@@ -1197,10 +1220,10 @@ vlc_module_begin(); ...@@ -1197,10 +1220,10 @@ vlc_module_begin();
NULL, SD_TEXT, SD_LONGTEXT, VLC_FALSE ); NULL, SD_TEXT, SD_LONGTEXT, VLC_FALSE );
change_short('S'); change_short('S');
/* Interface options */ /* Interface options */
set_category( CAT_INTERFACE ); set_category( CAT_INTERFACE );
set_subcategory( SUBCAT_INTERFACE_GENERAL ); set_subcategory( SUBCAT_INTERFACE_GENERAL );
add_category_hint( N_("Interface"), INTF_CAT_LONGTEXT , VLC_FALSE );
set_section ( N_("Interface module" ), NULL ); set_section ( N_("Interface module" ), NULL );
add_module_cat( "intf", SUBCAT_INTERFACE_GENERAL, NULL, NULL, INTF_TEXT, add_module_cat( "intf", SUBCAT_INTERFACE_GENERAL, NULL, NULL, INTF_TEXT,
INTF_LONGTEXT, VLC_FALSE ); INTF_LONGTEXT, VLC_FALSE );
...@@ -1228,7 +1251,7 @@ vlc_module_begin(); ...@@ -1228,7 +1251,7 @@ vlc_module_begin();
add_module_list_cat( "control", SUBCAT_INTERFACE_CONTROL, NULL, NULL, add_module_list_cat( "control", SUBCAT_INTERFACE_CONTROL, NULL, NULL,
CONTROL_TEXT, CONTROL_LONGTEXT, VLC_FALSE ); CONTROL_TEXT, CONTROL_LONGTEXT, VLC_FALSE );
/* Hotkey options*/ /* Hotkey options*/
set_subcategory( SUBCAT_INTERFACE_HOTKEYS ); set_subcategory( SUBCAT_INTERFACE_HOTKEYS );
add_category_hint( N_("Hot keys"), HOTKEY_CAT_LONGTEXT , VLC_FALSE ); add_category_hint( N_("Hot keys"), HOTKEY_CAT_LONGTEXT , VLC_FALSE );
...@@ -1493,7 +1516,7 @@ vlc_module_begin(); ...@@ -1493,7 +1516,7 @@ vlc_module_begin();
HISTORY_FORWARD_TEXT, HISTORY_FORWARD_LONGTEXT, VLC_TRUE ); HISTORY_FORWARD_TEXT, HISTORY_FORWARD_LONGTEXT, VLC_TRUE );
/* Usage (mainly useful for cmd line stuff) */ /* Usage (mainly useful for cmd line stuff) */
add_usage_hint( PLAYLIST_USAGE ); /* add_usage_hint( PLAYLIST_USAGE ); */
set_description( N_("main program") ); set_description( N_("main program") );
set_capability( "main", 100 ); set_capability( "main", 100 );
...@@ -1502,15 +1525,17 @@ vlc_module_end(); ...@@ -1502,15 +1525,17 @@ vlc_module_end();
static module_config_t p_help_config[] = static module_config_t p_help_config[] =
{ {
{ CONFIG_ITEM_BOOL, NULL, "help", 'h', { CONFIG_ITEM_BOOL, NULL, "help", 'h',
N_("print help (can be combined with --advanced)") }, N_("print help for VLC (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 help for VLC and all it's modules (can be combined with --advanced)") },
{ CONFIG_ITEM_BOOL, NULL, "advanced", '\0',
N_("print help for the advanced options") },
{ CONFIG_ITEM_BOOL, NULL, "help-verbose", '\0', { CONFIG_ITEM_BOOL, NULL, "help-verbose", '\0',
N_("ask for extra verbosity when displaying help") }, 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',
N_("print help on module (can be combined with --advanced)") }, N_("print help on a specific module (can be combined with --advanced)") },
{ CONFIG_ITEM_BOOL, NULL, "save-config", '\0', { CONFIG_ITEM_BOOL, NULL, "save-config", '\0',
N_("save the current command line options in the config") }, N_("save the current command line options in the config") },
{ CONFIG_ITEM_BOOL, NULL, "reset-config", '\0', { CONFIG_ITEM_BOOL, NULL, "reset-config", '\0',
......
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