Improve command line help to fit on narrower displays

- Update shell completions to reference recently added CLI arguments.
This commit is contained in:
Hugo Locurcio 2022-11-14 19:31:24 +01:00
parent 015dc492de
commit e6d8357685
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
4 changed files with 90 additions and 70 deletions

View File

@ -329,7 +329,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --path <directory> Path to a project (<directory> must contain a 'project.godot' file).\n");
OS::get_singleton()->print(" -u, --upwards Scan folders upwards for project.godot file.\n");
OS::get_singleton()->print(" --main-pack <file> Path to a pack (.pck) file to load.\n");
OS::get_singleton()->print(" --render-thread <mode> Render thread mode ('unsafe', 'safe', 'separate').\n");
OS::get_singleton()->print(" --render-thread <mode> Render thread mode ['unsafe', 'safe', 'separate'].\n");
OS::get_singleton()->print(" --remote-fs <address> Remote filesystem (<host/IP>[:<port>] address).\n");
OS::get_singleton()->print(" --remote-fs-password <password> Password for remote filesystem.\n");
@ -362,11 +362,12 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --rendering-method <renderer> Renderer name. Requires driver support.\n");
OS::get_singleton()->print(" --rendering-driver <driver> Rendering driver (depends on display driver).\n");
OS::get_singleton()->print(" --gpu-index <device_index> Use a specific GPU (run with --verbose to get available device list).\n");
OS::get_singleton()->print(" --text-driver <driver> Text driver (Fonts, BiDi, shaping)\n");
OS::get_singleton()->print(" --text-driver <driver> Text driver (Fonts, BiDi, shaping).\n");
OS::get_singleton()->print(" --tablet-driver <driver> Pen tablet input driver.\n");
OS::get_singleton()->print(" --headless Enable headless mode (--display-driver headless --audio-driver Dummy). Useful for servers and with --script.\n");
OS::get_singleton()->print(" --write-movie <file> Run the engine in a way that a movie is written (by default .avi MJPEG). Fixed FPS is forced when enabled, but can be used to change movie FPS. Disabling vsync can speed up movie writing but makes interaction more difficult.\n");
OS::get_singleton()->print(" --disable-vsync Force disabling of vsync. Run the engine in a way that a movie is written (by default .avi MJPEG). Fixed FPS is forced when enabled, but can be used to change movie FPS.\n");
OS::get_singleton()->print(" --write-movie <file> Writes a video to the specified path (usually with .avi or .png extension).\n");
OS::get_singleton()->print(" --fixed-fps is forced when enabled, but it can be used to change movie FPS.\n");
OS::get_singleton()->print(" --disable-vsync can speed up movie writing but makes interaction more difficult.\n");
OS::get_singleton()->print("\n");
@ -378,7 +379,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --resolution <W>x<H> Request window resolution.\n");
OS::get_singleton()->print(" --position <X>,<Y> Request window position.\n");
OS::get_singleton()->print(" --single-window Use a single window (no separate subwindows).\n");
OS::get_singleton()->print(" --xr-mode <mode> Select XR mode (default/off/on).\n");
OS::get_singleton()->print(" --xr-mode <mode> Select XR (Extended Reality) mode ['default', 'off', 'on'].\n");
OS::get_singleton()->print("\n");
OS::get_singleton()->print("Debug options:\n");
@ -399,6 +400,7 @@ void Main::print_help(const char *p_binary) {
#endif
OS::get_singleton()->print(" --frame-delay <ms> Simulate high CPU load (delay each frame by <ms> milliseconds).\n");
OS::get_singleton()->print(" --time-scale <scale> Force time scale (higher values are faster, 1.0 is normal speed).\n");
OS::get_singleton()->print(" --disable-vsync Forces disabling of vertical synchronization, even if enabled in the project settings. Does not override driver-level V-Sync enforcement.\n");
OS::get_singleton()->print(" --disable-render-loop Disable render loop so rendering only occurs when called explicitly from script.\n");
OS::get_singleton()->print(" --disable-crash-handler Disable crash handler when supported by the platform code.\n");
OS::get_singleton()->print(" --fixed-fps <fps> Force a fixed number of frames per second. This setting disables real-time synchronization.\n");
@ -412,10 +414,12 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --export-release <preset> <path> Export the project in release mode using the given preset and output path. The preset name should match one defined in export_presets.cfg.\n");
OS::get_singleton()->print(" <path> should be absolute or relative to the project directory, and include the filename for the binary (e.g. 'builds/game.exe').\n");
OS::get_singleton()->print(" The target directory must exist.\n");
OS::get_singleton()->print(" --export-debug <preset> <path> Export the project in debug mode using the given preset and output path. The preset name should match one defined in export_presets.cfg.\n");
OS::get_singleton()->print(" --export-debug <preset> <path> Export the project in debug mode using the given preset and output path. See --export-release description for other considerations.\n");
OS::get_singleton()->print(" --export-pack <preset> <path> Export the project data only using the given preset and output path. The <path> extension determines whether it will be in PCK or ZIP format.\n");
OS::get_singleton()->print(" --convert-3to4 [<max_file_kb>] [<max_line_size>] Converts project from Godot 3.x to Godot 4.x.\n");
OS::get_singleton()->print(" --validate-conversion-3to4 [<max_file_kb>] [<max_line_size>] Shows what elements will be renamed when converting project from Godot 3.x to Godot 4.x.\n");
OS::get_singleton()->print(" --convert-3to4 [<max_file_kb>] [<max_line_size>]\n");
OS::get_singleton()->print(" Converts project from Godot 3.x to Godot 4.x.\n");
OS::get_singleton()->print(" --validate-conversion-3to4 [<max_file_kb>] [<max_line_size>]\n");
OS::get_singleton()->print(" Shows what elements will be renamed when converting project from Godot 3.x to Godot 4.x.\n");
OS::get_singleton()->print(" --doctool [<path>] Dump the engine API reference to the given <path> (defaults to current dir) in XML format, merging if existing files are found.\n");
OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n");
OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects). Implies --editor and requires a valid project to edit.\n");

View File

@ -50,14 +50,15 @@ _arguments \
'--text-driver[set the text driver]:text driver name' \
'--tablet-driver[set the pen tablet input driver]:tablet driver name' \
'--headless[enable headless mode (--display-driver headless --audio-driver Dummy), useful for servers and with --script]' \
'--write-movie[writes a video to the specified path (usually with .avi or .png extension)]:path to output video file' \
'(-f --fullscreen)'{-f,--fullscreen}'[request fullscreen mode]' \
'(-m --maximized)'{-m,--maximized}'[request a maximized window]' \
'(-w --windowed)'{-w,--windowed}'[request windowed mode]' \
'(-t --always-on-top)'{-t,--always-on-top}'[request an always-on-top window]' \
'--resolution[request window resolution]:resolution in WxH format' \
'--position[request window position]:position in X,Y format' \
'--headless[enable headless mode (--display-driver headless --audio-driver Dummy). Useful for servers and with --script]' \
'--single-window[use a single window (no separate subwindows)]' \
'--xr-mode[select Extended Reality (XR) mode]:Extended Reality (XR) mode:(default off on)' \
'(-d --debug)'{-d,--debug}'[debug (local stdout debugger)]' \
'(-b --breakpoints)'{-b,--breakpoints}'[specify the breakpoint list as source::line comma-separated pairs, no spaces (use %20 instead)]:breakpoint list' \
'--profiling[enable profiling in the script debugger]' \
@ -70,6 +71,7 @@ _arguments \
'--debug-stringnames[print all StringName allocations to stdout when the engine quits]' \
'--frame-delay[simulate high CPU load (delay each frame by the given number of milliseconds)]:number of milliseconds' \
'--time-scale[force time scale (higher values are faster, 1.0 is normal speed)]:time scale' \
'--disable-vsync[disable vertical synchronization even if enabled in the project settings]' \
'--disable-render-loop[disable render loop so rendering only occurs when called explicitly from script]' \
'--disable-crash-handler[disable crash handler when supported by the platform code]' \
'--fixed-fps[force a fixed number of frames per second (this setting disables real-time synchronization)]:frames per second' \
@ -86,4 +88,6 @@ _arguments \
'--build-solutions[build the scripting solutions (e.g. for C# projects)]' \
'--dump-gdextension-interface[generate GDExtension header file 'gdnative_interface.h' in the current folder. This file is the base file required to implement a GDExtension.]' \
'--dump-extension-api[generate JSON dump of the Godot API for GDExtension bindings named "extension_api.json" in the current folder]' \
'--startup-benchmark[benchmark the startup time and print it to console]' \
'--startup-benchmark-file[benchmark the startup time and save it to a given file in JSON format]:path to output JSON file' \
'--test[run all unit tests; run with "--test --help" for more information]'

View File

@ -53,6 +53,7 @@ _complete_godot_options() {
--text-driver
--tablet-driver
--headless
--write-movie
--fullscreen
--maximized
--windowed
@ -60,6 +61,7 @@ _complete_godot_options() {
--resolution
--position
--single-window
--xr-mode
--debug
--breakpoints
--profiling
@ -72,6 +74,7 @@ _complete_godot_options() {
--debug-stringnames
--frame-delay
--time-scale
--disable-vsync
--disable-render-loop
--disable-crash-handler
--fixed-fps
@ -88,6 +91,8 @@ _complete_godot_options() {
--build-solutions
--dump-gdextension-interface
--dump-extension-api
--startup-benchmark
--startup-benchmark-file
--test
" -- "$1"))
}
@ -121,6 +126,10 @@ _complete_godot_bash() {
local IFS=$' \n\t'
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "vulkan opengl3 dummy" -- "$cur"))
elif [[ $prev == "--xr-mode" ]]; then
local IFS=$' \n\t'
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "default off on" -- "$cur"))
elif [[ $prev == "--path" || $prev == "--doctool" ]]; then
local IFS=$'\n\t'
# shellcheck disable=SC2207

View File

@ -66,6 +66,7 @@ complete -c godot -l gpu-index -d "Use a specific GPU (run with --verbose to get
complete -c godot -l text-driver -d "Set the text driver" -x
complete -c godot -l tablet-driver -d "Set the pen tablet input driver" -x
complete -c godot -l headless -d "Enable headless mode (--display-driver headless --audio-driver Dummy). Useful for servers and with --script"
complete -c godot -l write-movie -d "Writes a video to the specified path (usually with .avi or .png extension). --fixed-fps is forced when enabled" -x
# Display options:
complete -c godot -s f -l fullscreen -d "Request fullscreen mode"
@ -74,8 +75,8 @@ complete -c godot -s w -l windowed -d "Request windowed mode"
complete -c godot -s t -l always-on-top -d "Request an always-on-top window"
complete -c godot -l resolution -d "Request window resolution" -x
complete -c godot -l position -d "Request window position" -x
complete -c godot -l headless -d "Enable headless mode (--display-driver headless --audio-driver Dummy). Useful for servers and with --script"
complete -c godot -l single-window -d "Use a single window (no separate subwindows)"
complete -c godot -l xr-mode -d "Select Extended Reality (XR) mode" -a "default off on"
# Debug options:
complete -c godot -s d -l debug -d "Debug (local stdout debugger)"
@ -108,4 +109,6 @@ complete -c godot -l no-docbase -d "Disallow dumping the base types (used with -
complete -c godot -l build-solutions -d "Build the scripting solutions (e.g. for C# projects)"
complete -c godot -l dump-gdextension-interface -d "Generate GDExtension header file 'gdnative_interface.h' in the current folder. This file is the base file required to implement a GDExtension"
complete -c godot -l dump-extension-api -d "Generate JSON dump of the Godot API for GDExtension bindings named 'extension_api.json' in the current folder"
complete -c godot -l startup-benchmark -d "Benchmark the startup time and print it to console"
complete -c godot -l startup-benchmark-file -d "Benchmark the startup time and save it to a given file in JSON format" -x
complete -c godot -l test -d "Run all unit tests; run with '--test --help' for more information" -x