From 3402c0d4204e16c783cac0763113208b3b3840b8 Mon Sep 17 00:00:00 2001 From: twinaphex <libretro@gmail.com> Date: Mon, 1 Aug 2016 18:35:56 +0200 Subject: [PATCH] When building without menu support, if we pass no arguments to retroarch at the commandline, show the help message instead of outright crashing --- retroarch.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/retroarch.c b/retroarch.c index dda8d93c99..afc1c7735f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -248,8 +248,8 @@ static void retroarch_print_help(const char *arg0) "\n\t\tBy default looks for config in $XDG_CONFIG_HOME/retroarch/" "retroarch.cfg,\n\t\t$HOME/.config/retroarch/retroarch.cfg,\n\t\t" "and $HOME/.retroarch.cfg.\n\t\tIf a default config is not found, " - "the program will attempt to create one based on the skeleton " - "config (" GLOBAL_CONFIG_DIR "/retroarch.cfg)." + "the program will attempt to create one based on the \n\t\t" + "skeleton config (" GLOBAL_CONFIG_DIR "/retroarch.cfg). \n" #endif ); puts(" --appendconfig=FILE\n" @@ -736,6 +736,15 @@ static void retroarch_parse_input(int argc, char *argv[]) optstring = "hs:fvS:A:c:U:DN:d:" BSV_MOVIE_ARG NETPLAY_ARG DYNAMIC_ARG FFMPEG_RECORD_ARG; +#ifndef HAVE_MENU + if (argc == 1) + { + printf("No arguments supplied and no menu builtin, displaying help...\n"); + retroarch_print_help(argv[0]); + exit(0); + } +#endif + for (;;) { int port;