Console help output cleanup (#13678)

This commit is contained in:
Tony 2022-02-27 06:30:04 +02:00 committed by GitHub
parent ba0d42ceb3
commit 3b1d75d9cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4085,173 +4085,209 @@ static void retroarch_print_version(void)
**/ **/
static void retroarch_print_help(const char *arg0) static void retroarch_print_help(const char *arg0)
{ {
char buf[2048];
buf[0] = '\0';
frontend_driver_attach_console(); frontend_driver_attach_console();
fputs("\n", stdout);
puts("==================================================================="); puts("===================================================================");
retroarch_print_version(); retroarch_print_version();
puts("==================================================================="); puts("===================================================================");
fputs("\n", stdout);
printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); printf("Usage: %s [OPTIONS]... [FILE]\n\n", arg0);
{ strlcat(buf, " -h, --help "
char buf[2720]; "Show this help message.\n", sizeof(buf));
buf[0] = '\0'; strlcat(buf, " -v, --verbose "
"Verbose logging.\n", sizeof(buf));
strlcpy(buf, " -h, --help Show this help message.\n", sizeof(buf)); strlcat(buf, " --log-file=FILE "
strlcat(buf, " -v, --verbose Verbose logging.\n", sizeof(buf)); "Log messages to FILE.\n", sizeof(buf));
strlcat(buf, " --log-file FILE Log messages to FILE.\n", sizeof(buf)); strlcat(buf, " --version "
strlcat(buf, " --version Show version.\n", sizeof(buf)); "Show version.\n", sizeof(buf));
strlcat(buf, " --features Prints available features compiled into " strlcat(buf, " --features "
"program.\n", sizeof(buf)); "Print available features compiled into program.\n", sizeof(buf));
#ifdef HAVE_MENU #ifdef HAVE_MENU
strlcat(buf, " --menu Do not require content or libretro core to " strlcat(buf, " --menu "
"be loaded,\n" "Do not require content or libretro core to be loaded,\n", sizeof(buf));
" starts directly in menu. If no arguments " strlcat(buf, " "
"are passed to\n" " starts directly in menu. If no arguments are passed to\n", sizeof(buf));
" the program, it is equivalent to using " strlcat(buf, " "
"--menu as only argument.\n", sizeof(buf)); " the program, it is equivalent to using --menu as only argument.\n", sizeof(buf));
#endif #endif
strlcat(buf, " -s, --save=PATH Path for save files (*.srm). (DEPRECATED, use --appendconfig and savefile_directory)\n", sizeof(buf));
strlcat(buf, " -S, --savestate=PATH Path for the save state files (*.state). (DEPRECATED, use --appendconfig and savestate_directory)\n", sizeof(buf));
strlcat(buf, " --set-shader PATH Path to a shader (preset) that will be loaded each time content is loaded.\n"
" Effectively overrides automatic shader presets.\n"
" An empty argument \"\" will disable automatic shader presets.\n", sizeof(buf));
strlcat(buf, " -f, --fullscreen Start the program in fullscreen regardless "
"of config settings.\n", sizeof(buf));
#ifdef HAVE_CONFIGFILE #ifdef HAVE_CONFIGFILE
strlcat(buf, " -c, --config=FILE "
"Path for config file.\n", sizeof(buf));
#ifdef _WIN32 #ifdef _WIN32
strlcat(buf, " -c, --config=FILE Path for config file." strlcat(buf, " "
"\n\t\tDefaults to retroarch.cfg in same directory as retroarch.exe." " Defaults to retroarch.cfg in same directory as retroarch.exe.\n", sizeof(buf));
"\n\t\tIf a default config is not found, the program will attempt to " strlcat(buf, " "
"create one.\n" " If a default config is not found, the program will attempt to create one.\n", sizeof(buf));
, sizeof(buf));
#else #else
strlcat(buf, " -c, --config=FILE Path for config file." strlcat(buf, " "
"\n\t\tBy default looks for config in $XDG_CONFIG_HOME/retroarch/" " By default looks for config in\n", sizeof(buf));
"retroarch.cfg,\n\t\t$HOME/.config/retroarch/retroarch.cfg,\n\t\t" strlcat(buf, " "
"and $HOME/.retroarch.cfg.\n\t\tIf a default config is not found, " " $XDG_CONFIG_HOME/retroarch/retroarch.cfg,\n", sizeof(buf));
"the program will attempt to create one based on the \n\t\t" strlcat(buf, " "
"skeleton config (" GLOBAL_CONFIG_DIR "/retroarch.cfg). \n" " $HOME/.config/retroarch/retroarch.cfg, and\n", sizeof(buf));
, sizeof(buf)); strlcat(buf, " "
" $HOME/.retroarch.cfg.\n", sizeof(buf));
strlcat(buf, " "
" If a default config is not found, the program will attempt to create one\n", sizeof(buf));
strlcat(buf, " "
" based on the skeleton config (" GLOBAL_CONFIG_DIR "/retroarch.cfg).\n", sizeof(buf));
#endif #endif
strlcat(buf, " --appendconfig=FILE "
"Extra config files are loaded in, and take priority over\n", sizeof(buf));
strlcat(buf, " "
" config selected in -c (or default). Multiple configs are\n", sizeof(buf));
strlcat(buf, " "
" delimited by '|'.\n", sizeof(buf));
#endif #endif
strlcat(buf, " --appendconfig=FILE\n"
" Extra config files are loaded in, " fputs(buf, stdout);
"and take priority over\n" buf[0] = '\0';
" config selected in -c (or default). "
"Multiple configs are\n"
" delimited by '|'.\n", sizeof(buf));
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
/* Note: Must strlcat the the string literal in two passes strlcat(buf, " -L, --libretro=FILE "
* due to C89 limitations (509 character limit) */ "Path to libretro implementation. Overrides any config setting.\n", sizeof(buf));
strlcat(buf, " -L, --libretro=FILE Path to libretro implementation. " strlcat(buf, " "
"Overrides any config setting. FILE may be one of the following:" " FILE may be one of the following:\n", sizeof(buf));
, sizeof(buf)); strlcat(buf, " "
strlcat(buf, " 1. The full path to a core shared object library: path/to/<core_name>_libretro.<lib_ext>\n", sizeof(buf));
"\n\t\t1. The full path to a core shared object library: path/to/<core_name>_libretro.<lib_ext>" strlcat(buf, " "
"\n\t\t2. A core shared object library 'file name' (*): <core_name>_libretro.<lib_ext>" " 2. A core shared object library 'file name' (*): <core_name>_libretro.<lib_ext>\n", sizeof(buf));
"\n\t\t3. A core 'short name' (*): <core_name>_libretro OR <core_name>" strlcat(buf, " "
"\n\t\t(*) If 'file name' or 'short name' do not correspond to an existing full file path," " 3. A core 'short name' (*): <core_name>_libretro OR <core_name>\n", sizeof(buf));
"\n\t\t the configured frontend 'cores' directory will be searched for a match\n" strlcat(buf, " "
, sizeof(buf)); " (*) If 'file name' or 'short name' do not correspond to an existing full file path,\n", sizeof(buf));
strlcat(buf, " "
" the configured frontend 'cores' directory will be searched for a match.\n", sizeof(buf));
#endif #endif
strlcat(buf, " --subsystem=NAME Use a subsystem of the libretro core. "
"Multiple content\n"
" files are loaded as multiple arguments. "
"If a content\n"
" file is skipped, use a blank (\"\") "
"command line argument.\n"
" Content must be loaded in an order "
"which depends on the\n"
" particular subsystem used. See verbose "
"log output to learn\n"
" how a particular subsystem wants content "
"to be loaded.\n", sizeof(buf));
puts(buf);
}
printf(" -N, --nodevice=PORT\n" strlcat(buf, " --subsystem=NAME "
" Disconnects controller device connected " "Use a subsystem of the libretro core. Multiple content\n", sizeof(buf));
"to PORT (1 to %d).\n", MAX_USERS); strlcat(buf, " "
printf(" -A, --dualanalog=PORT\n" " files are loaded as multiple arguments. If a content\n", sizeof(buf));
" Connect a DualAnalog controller to PORT " strlcat(buf, " "
"(1 to %d).\n", MAX_USERS); " file is skipped, use a blank (\"\") command line argument.\n", sizeof(buf));
printf(" -d, --device=PORT:ID\n" strlcat(buf, " "
" Connect a generic device into PORT of " " Content must be loaded in an order which depends on the\n", sizeof(buf));
"the device (1 to %d).\n", MAX_USERS); strlcat(buf, " "
" particular subsystem used. See verbose log output to learn\n", sizeof(buf));
strlcat(buf, " "
" how a particular subsystem wants content to be loaded.\n", sizeof(buf));
strlcat(buf, " -f, --fullscreen "
"Start the program in fullscreen regardless of config setting.\n", sizeof(buf));
strlcat(buf, " --set-shader=PATH "
"Path to a shader (preset) that will be loaded each time content is loaded.\n", sizeof(buf));
strlcat(buf, " "
" Effectively overrides automatic shader presets.\n", sizeof(buf));
strlcat(buf, " "
" An empty argument \"\" will disable automatic shader presets.\n", sizeof(buf));
fputs(buf, stdout);
buf[0] = '\0';
printf( " -N, --nodevice=PORT "
"Disconnects controller device connected to PORT (1 to %d).\n", MAX_USERS);
printf( " -A, --dualanalog=PORT "
"Connect a DualAnalog controller to PORT (1 to %d).\n", MAX_USERS);
printf( " -d, --device=PORT:ID "
"Connect a generic device into PORT of the device (1 to %d).\n", MAX_USERS);
strlcat(buf, " "
" Format is PORT:ID, where ID is a number corresponding to the particular device.\n", sizeof(buf));
strlcat(buf, " -M, --sram-mode=MODE "
"SRAM handling mode. MODE can be:\n", sizeof(buf));
strlcat(buf, " "
" 'noload-nosave', 'noload-save', 'load-nosave' or 'load-save'.\n", sizeof(buf));
strlcat(buf, " "
" Note: 'noload-save' implies that save files *WILL BE OVERWRITTEN*.\n", sizeof(buf));
{
char buf[2560];
buf[0] = '\0';
strlcpy(buf, " Format is PORT:ID, where ID is a number "
"corresponding to the particular device.\n", sizeof(buf));
#ifdef HAVE_BSV_MOVIE
strlcat(buf, " -P, --bsvplay=FILE Playback a BSV movie file.\n", sizeof(buf));
strlcat(buf, " -R, --bsvrecord=FILE Start recording a BSV movie file from "
"the beginning.\n", sizeof(buf));
strlcat(buf, " --eof-exit Exit upon reaching the end of the "
"BSV movie file.\n", sizeof(buf));
#endif
strlcat(buf, " -M, --sram-mode=MODE SRAM handling mode. MODE can be "
"'noload-nosave',\n"
" 'noload-save', 'load-nosave' or "
"'load-save'.\n"
" Note: 'noload-save' implies that "
"save files *WILL BE OVERWRITTEN*.\n", sizeof(buf));
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
strlcat(buf, " -H, --host Host netplay as user 1.\n", sizeof(buf)); strlcat(buf, " -H, --host "
strlcat(buf, " -C, --connect=HOST Connect to netplay server as user 2.\n", sizeof(buf)); "Host netplay as user 1.\n", sizeof(buf));
strlcat(buf, " --port=PORT Port used to netplay. Default is 55435.\n", sizeof(buf)); strlcat(buf, " -C, --connect=HOST "
strlcat(buf, " --stateless Use \"stateless\" mode for netplay\n", sizeof(buf)); "Connect to netplay server as user 2.\n", sizeof(buf));
strlcat(buf, " (requires a very fast network).\n", sizeof(buf)); strlcat(buf, " --port=PORT "
strlcat(buf, " --check-frames=NUMBER\n" "Port used to netplay. Default is 55435.\n", sizeof(buf));
" Check frames when using netplay.\n", sizeof(buf)); strlcat(buf, " --nick=NICK "
"Picks a username (for use with netplay). Not mandatory.\n", sizeof(buf));
strlcat(buf, " --stateless "
"Use \"stateless\" mode for netplay (requires a very fast network).\n", sizeof(buf));
strlcat(buf, " --check-frames=NUMBER "
"Check frames when using netplay.\n", sizeof(buf));
#ifdef HAVE_NETWORK_CMD #ifdef HAVE_NETWORK_CMD
strlcat(buf, " --command Sends a command over UDP to an already " strlcat(buf, " --command "
"running program process.\n", sizeof(buf)); "Sends a command over UDP to an already running program process.\n", sizeof(buf));
strlcat(buf, " Available commands are listed if command is invalid.\n", sizeof(buf)); strlcat(buf, " "
" Available commands are listed if command is invalid.\n", sizeof(buf));
#endif
#endif #endif
#ifdef HAVE_BSV_MOVIE
strlcat(buf, " -P, --bsvplay=FILE "
"Playback a BSV movie file.\n", sizeof(buf));
strlcat(buf, " -R, --bsvrecord=FILE "
"Start recording a BSV movie file from the beginning.\n", sizeof(buf));
strlcat(buf, " --eof-exit "
"Exit upon reaching the end of the BSV movie file.\n", sizeof(buf));
#endif #endif
strlcat(buf, " --nick=NICK Picks a username (for use with netplay). " strlcat(buf, " -r, --record=FILE "
"Not mandatory.\n", sizeof(buf)); "Path to record video file. Using mkv extension is recommended.\n", sizeof(buf));
strlcat(buf, " -r, --record=FILE Path to record video file.\n " strlcat(buf, " --recordconfig "
"Using .mkv extension is recommended.\n", sizeof(buf)); "Path to settings used during recording.\n", sizeof(buf));
strlcat(buf, " --recordconfig Path to settings used during recording.\n", sizeof(buf)); strlcat(buf, " --size=WIDTHxHEIGHT "
strlcat(buf, " --size=WIDTHxHEIGHT\n" "Overrides output video size when recording.\n", sizeof(buf));
" Overrides output video size when recording.\n", sizeof(buf));
fputs(buf, stdout);
buf[0] = '\0';
strlcat(buf, " -D, --detach "
"Detach program from the running console. Not relevant for all platforms.\n", sizeof(buf));
strlcat(buf, " --max-frames=NUMBER "
"Runs for the specified number of frames, then exits.\n", sizeof(buf));
#ifdef HAVE_PATCH #ifdef HAVE_PATCH
strlcat(buf, " -U, --ups=FILE Specifies path for UPS patch that will be " strlcat(buf, " -U, --ups=FILE "
"applied to content.\n", sizeof(buf)); "Specifies path for UPS patch that will be applied to content.\n", sizeof(buf));
strlcat(buf, " --bps=FILE Specifies path for BPS patch that will be " strlcat(buf, " --bps=FILE "
"applied to content.\n", sizeof(buf)); "Specifies path for BPS patch that will be applied to content.\n", sizeof(buf));
strlcat(buf, " --ips=FILE Specifies path for IPS patch that will be " strlcat(buf, " --ips=FILE "
"applied to content.\n", sizeof(buf)); "Specifies path for IPS patch that will be applied to content.\n", sizeof(buf));
strlcat(buf, " --no-patch Disables all forms of content patching.\n", sizeof(buf)); strlcat(buf, " --no-patch "
"Disables all forms of content patching.\n", sizeof(buf));
#endif #endif
strlcat(buf, " -D, --detach Detach program from the running console. "
"Not relevant for all platforms.\n", sizeof(buf));
strlcat(buf, " --max-frames=NUMBER\n"
" Runs for the specified number of frames, "
"then exits.\n", sizeof(buf));
#ifdef HAVE_SCREENSHOTS #ifdef HAVE_SCREENSHOTS
strlcat(buf, " --max-frames-ss\n" strlcat(buf, " --max-frames-ss "
" Takes a screenshot at the end of max-frames.\n", sizeof(buf)); "Takes a screenshot at the end of max-frames.\n", sizeof(buf));
strlcat(buf, " --max-frames-ss-path=FILE\n" strlcat(buf, " --max-frames-ss-path=FILE "
" Path to save the screenshot to at the end of max-frames.\n", sizeof(buf)); "Path to save the screenshot to at the end of max-frames.\n", sizeof(buf));
#endif #endif
#ifdef HAVE_ACCESSIBILITY #ifdef HAVE_ACCESSIBILITY
strlcat(buf, " --accessibility\n" strlcat(buf, " --accessibility "
" Enables accessibilty for blind users using text-to-speech.\n", sizeof(buf)); "Enables accessibilty for blind users using text-to-speech.\n", sizeof(buf));
#endif #endif
strlcat(buf, " --load-menu-on-error\n"
" Open menu instead of quitting if specified core or content fails to load.\n", sizeof(buf)); strlcat(buf, " --load-menu-on-error "
strlcat(buf, " -e, --entryslot=NUMBER\n" "Open menu instead of quitting if specified core or content fails to load.\n", sizeof(buf));
" Slot from which to load an entry state\n", sizeof(buf)); strlcat(buf, " -e, --entryslot=NUMBER "
puts(buf); "Slot from which to load an entry state.\n", sizeof(buf));
}
strlcat(buf, " -s, --save=PATH "
"Path for save files (*.srm). (DEPRECATED, use --appendconfig and savefile_directory)\n", sizeof(buf));
strlcat(buf, " -S, --savestate=PATH "
"Path for the save state files (*.state). (DEPRECATED, use --appendconfig and savestate_directory)\n", sizeof(buf));
fputs(buf, stdout);
fputs("\n", stdout);
} }
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC