OoliteProject / oolite

The main Oolite repository.
https://www.oolite.space
543 stars 70 forks source link

Introducing -help / --help Command Line Option #482

Closed AnotherCommander closed 1 month ago

AnotherCommander commented 1 month ago

This PR aims to assist new players trying to work their way through the game at its early stages. It enables the -help (--help also works) command line option. Entering [-]-help as a command line parameter opens up a message box with the list of available command line options on Windows, while on Linux it sends all output to stdout. The game will exit if the [-]-help parameter is detected in the command line args, immediately after the help info has been displayed. The exit code in this case is 2, which means exiting due to [-]-help found.

A short message indicating the exit reason is sent to the actual log as well. This is to avoid sudden termination of the log file, which could lead to the potential (wrong) assumption that a crash occurred.

AnotherCommander commented 1 month ago

I would appreciate some feedback from Linux users. Does this work OK for you? Note that the tabs in the command line args output may be a bit off in Linux; I wouldn't worry too much about that, the tabs are calibrated for correct display inside the Windows message box.