Skip to content

Commit

Permalink
enhancement: check for usage help cmd line parameter early
Browse files Browse the repository at this point in the history
Check for the -h or --help parameter early, before initializing SDL2. This allows the print of the usage text output even in environments where no display hardware exists, and the GUI would normally fail to show.
  • Loading branch information
midwan committed Nov 3, 2023
1 parent 5566dfb commit b4f1bd9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3579,6 +3579,11 @@ bool data_dir_exists(char* directory)

int main(int argc, char* argv[])
{
for (auto i = 1; i < argc; i++) {
if (_tcscmp(argv[i], _T("-h")) == 0 || _tcscmp(argv[i], _T("--help")) == 0)
usage();
}

struct sigaction action{};

max_uae_width = 8192;
Expand Down

0 comments on commit b4f1bd9

Please sign in to comment.