Skip to content

Commit

Permalink
desktop-ui: Document command-line options and add --help
Browse files Browse the repository at this point in the history
Ideally I think one should not need to read the source code to learn
that ares accepts command-line options and what those options are.

I wish I had known earlier that I could pass --system MSX when loading
a ROM directly, it would have saved me a lot of time. I had tried --help,
but it just opened the application window...
  • Loading branch information
raphnet authored and LukeUsher committed Sep 6, 2022
1 parent 972495d commit 03186eb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ Build Output

There is a single binary produced at the end of compilation which can be found in `desktop-ui/out`. On OS's besides Linux, the `Database` & `Shader` directories are copied over here as well. On Linux, running `make install` after compilation will copy these directories and binary into suitable locations (see desktop-ui/GNUmakefile for details). Alternatively, these directories can be copied from `ares/Shaders/*` and `mia/Database/*`.


Command-line options
--------------------

When started from the command-line, ares accepts a few options.

```
Usage: ./ares [options] game
--help Displays available options and exit
--fullscreen Start in full screen mode
--system system Specify the system name
```

The --system option is useful when the system type cannot be auto-detected.
--fullscreen will only have an effect if a game is also passed in argument.

Example:
`ares --system MSX examples.rom --fullscreen`


High-level Components
---------------------

Expand Down
17 changes: 17 additions & 0 deletions desktop-ui/desktop-ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ auto nall::main(Arguments arguments) -> void {

inputManager.create();
Emulator::construct();

if(arguments.take("--help")) {
print("Usage: ares [OPTIONS]... game\n\n");
print("Options:\n");
print(" --help Displays available options and exit\n");
print(" --fullscreen Start in full screen mode\n");
print(" --system name Specifiy the system name\n");
print("\n");
print("Available Systems:\n");
print(" ");
for(auto& emulator : emulators) {
print(emulator->name, ", ");
}
print("\n");
return;
}

settings.load();
Instances::presentation.construct();
Instances::settingsWindow.construct();
Expand Down

0 comments on commit 03186eb

Please sign in to comment.