Skip to content

Commit b6c2c60

Browse files
committed
docs: add command line help; update docs
1 parent c13eb4d commit b6c2c60

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,4 @@ Rendering distance is not customizable.
178178
| `-aa <number>` | enable anti-aliasing (number = 1-2, 2 = most expensive AA) |
179179
| `-window` | windowed debugging mode (not to be used for playing) |
180180
| `-benchmark [ci]` | run automated benchmark, reports avg/1% low FPS to stdout and log.txt; `ci` exits after completion |
181+
| `-h` `--help` | show help message |

doc/Gothic2Notr.6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ is specified, the program exits automatically after completion (useful
8282
for regression testing). The benchmark can be restarted in-game with
8383
.B ztoggle timedemo
8484
or cancelled by loading a save game.
85+
.TP
86+
.BR \-h ", " \-\-help
87+
Print a brief help message and exit.
8588
.SH GRAPHICS OPTIONS
8689
The in-game menu provides additional graphics settings:
8790
.TP

game/commandline.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <Tempest/Log>
44
#include <Tempest/TextCodec>
55
#include <cstring>
6+
#include <cstdio>
7+
#include <cstdlib>
68
#include <cassert>
79

810
#if defined(__APPLE__)
@@ -48,7 +50,33 @@ CommandLine::CommandLine(int argc, const char** argv) {
4850
std::string_view mod;
4951
for(int i=1;i<argc;++i) {
5052
std::string_view arg = argv[i];
51-
if(arg.find("-game:")==0) {
53+
if(arg=="-h" || arg=="--help") {
54+
std::printf(
55+
"Usage: Gothic2Notr [options]\n"
56+
"\n"
57+
"Options:\n"
58+
" -g <path> Path to Gothic game data\n"
59+
" -game:<mod.ini> Load game modification\n"
60+
" -nomenu Skip main menu\n"
61+
" -devmode Enable marvin-mode\n"
62+
" -w <world.zen> Startup world (default: newworld.zen)\n"
63+
" -save q|<number> Load quick save or save slot\n"
64+
" -v, -validation Enable graphics validation layers\n"
65+
" -dx12 Force DirectX 12 (Windows only)\n"
66+
" -g1, -g2c, -g2 Assume Gothic 1/2 Classic/2 NotR\n"
67+
" -rt <0|1> Enable/disable ray-query\n"
68+
" -gi <0|1> Enable/disable ray-traced GI\n"
69+
" -ms <0|1> Enable/disable meshlets\n"
70+
" -aa <0-2> Anti-aliasing level\n"
71+
" -window Windowed mode\n"
72+
" -benchmark [ci] Run benchmark (ci: exit after)\n"
73+
" -h, --help Show this help\n"
74+
"\n"
75+
"See Gothic2Notr(6) man page for details.\n"
76+
);
77+
std::exit(0);
78+
}
79+
else if(arg.find("-game:")==0) {
5280
if(!mod.empty())
5381
Log::e("-game specified twice");
5482
mod = arg.substr(6);

0 commit comments

Comments
 (0)