diff --git a/INSTALL.md b/INSTALL.md index 7edc5a4b5..7e397029f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -131,6 +131,7 @@ Assuming the default installation prefix `/usr/local` has been used, this is the ``` /usr/local/bin/emulationstation +/usr/local/man/man6/emulationstation.6.gz /usr/local/share/applications/emulationstation.desktop /usr/local/share/emulationstation/LICENSE /usr/local/share/emulationstation/LICENSES/* diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 67c51a23f..3063a728c 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -124,6 +124,8 @@ if(WIN32) else() install(TARGETS emulationstation RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/emulationstation.6.gz + DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man6) install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/emulationstation.desktop diff --git a/es-app/src/emulationstation.6.gz b/es-app/src/emulationstation.6.gz new file mode 100644 index 000000000..d68d25031 Binary files /dev/null and b/es-app/src/emulationstation.6.gz differ diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 4f703f8d7..554cffe50 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -276,28 +276,28 @@ bool parseArgs(int argc, char* argv[]) } else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { std::cout << -"EmulationStation Desktop Edition\n" -"An Emulator Front-end\n\n" +"Usage: emulationstation [options]\n" +"EmulationStation Desktop Edition, Emulator Front-end\n\n" "Options:\n" -"--resolution [width] [height] Try to force a particular resolution\n" -"--gamelist-only Skip automatic game ROM search, only read from gamelist.xml\n" -"--ignore-gamelist Ignore the gamelist files (useful for troubleshooting)\n" -"--draw-framerate Display the framerate\n" -"--no-exit Don't show the exit option in the menu\n" -"--no-splash Don't show the splash screen\n" -"--debug Print debug information\n" -"--windowed Windowed mode, should be combined with --resolution\n" -"--fullscreen-normal Normal fullscreen mode\n" -"--fullscreen-borderless Borderless fullscreen mode (always on top)\n" -"--vsync [1/on or 0/off] Turn vsync on or off (default is on)\n" -"--max-vram [size] Max VRAM to use in Mb before swapping\n" -" Set to at least 20 to avoid unpredictable behavior\n" -"--force-kid Force the UI mode to Kid\n" -"--force-kiosk Force the UI mode to Kiosk\n" -"--force-disable-filters Force the UI to ignore applied filters in gamelist\n" -"--home [path] Directory to use as home path\n" -"--version, -v Displays version information\n" -"--help, -h Summon a sentient, angry tuba\n"; +" --resolution [width] [height] Try to force a particular resolution\n" +" --gamelist-only Skip automatic game ROM search, only read from gamelist.xml\n" +" --ignore-gamelist Ignore the gamelist files (useful for troubleshooting)\n" +" --draw-framerate Display the framerate\n" +" --no-exit Don't show the exit option in the menu\n" +" --no-splash Don't show the splash screen\n" +" --debug Print debug information\n" +" --windowed Windowed mode, should be combined with --resolution\n" +" --fullscreen-normal Normal fullscreen mode\n" +" --fullscreen-borderless Borderless fullscreen mode (always on top)\n" +" --vsync [1/on or 0/off] Turn vsync on or off (default is on)\n" +" --max-vram [size] Max VRAM to use in Mb before swapping\n" +" Set to at least 20 to avoid unpredictable behavior\n" +" --force-kid Force the UI mode to Kid\n" +" --force-kiosk Force the UI mode to Kiosk\n" +" --force-disable-filters Force the UI to ignore applied filters in gamelist\n" +" --home [path] Directory to use as home path\n" +" --version, -v Display version information\n" +" --help, -h Summon a sentient, angry tuba\n"; return false; // Exit after printing help. } else { diff --git a/tools/generate_man_page.sh b/tools/generate_man_page.sh new file mode 100755 index 000000000..c2ebce47c --- /dev/null +++ b/tools/generate_man_page.sh @@ -0,0 +1,59 @@ +#!/usr/bin/bash +# +# generate_man_page.sh +# Generate a Unix manual page for EmulationStation Desktop Edition. +# +# This script only takes an optional argument which is the location to the ES binary. +# If not provided, the default path will be searched for the binary 'emulationstation'. +# +# The man page will be generated in the same directory as where the script is executed. +# +# The command help2man must be installed, or the script will fail. +# +# Leon Styhre +# 2020-07-16 +# + +if [ $# -ne 1 ]; then + ESBINARY=emulationstation +else + ESBINARY=$1 +fi + +TEMPFILE_INPUT=tempfile_input_$(date +%H%M%S) +TEMPFILE_OUTPUT=tempfile_output_$(date +%H%M%S) +TARGET_FILENAME=emulationstation.6 + +MAN_INCLUDE=" +[NAME] +emulationstation - EmulationStation Desktop Edition + +[DESCRIPTION] +EmulationStation Desktop Edition is a fast and flexible front-end for browsing and launching games from your multi-platform retro game collection. + +It's intended to be used in conjunction with emulators such as the RetroArch cores. + +[AUTHOR] +Alec \"Aloshi\" Lofquist (original version) + +RetroPie Community (RetroPie fork) + +Leon Styhre (Desktop Edition fork) + +[SEE ALSO] +Full documentation is available at: +" + +echo "${MAN_INCLUDE}" > $TEMPFILE_INPUT + +help2man --section 6 --no-info --include $TEMPFILE_INPUT $ESBINARY > $TEMPFILE_OUTPUT + +# Manual string replacements, these may need to be modified if changes are made to the +# command line --help output. +cat $TEMPFILE_OUTPUT | sed s/"EmulationStation Desktop Edition, Emulator Front\\\-end"/""/g | \ +sed s/"Set to at least"/".br\nSet to at least"/ > $TARGET_FILENAME + +gzip $TARGET_FILENAME + +rm $TEMPFILE_INPUT +rm $TEMPFILE_OUTPUT