Skip to content

Commit

Permalink
adding help to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
celestialorb committed Oct 28, 2024
1 parent 0d08ced commit 9f40e0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ Basic help with usage can be obtained via the `--help` flag:

```sh
$ /opt/exporter/exporter.py run --help

Usage: exporter.py run [OPTIONS]

Start the Factorio Prometheus exporter.

╭─ Options ──────────────────────────────────────────────────────────────────────────────────╮
│ --metrics-port INTEGER The port to expose the metrics endpoint on.
│ --rcon-address TEXT The address for the Factorio server.
│ --rcon-port INTEGER The RCON port for the Factorio server.
│ --rcon-password TEXT The RCON password for the server.
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────╯
Usage: exporter.py run [OPTIONS]
Start the Factorio Prometheus exporter.
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ --metrics-port INTEGER The port to expose the metrics endpoint on, defaults to 9102.
│ --rcon-address TEXT The address for the Factorio server, defaults to localhost.
│ --rcon-port INTEGER The RCON port for the Factorio server, defaults to 27015.
│ --rcon-password TEXT The RCON password for the server, defaults to attempting to read it from the local config.
│ --help Show this message and exit.
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
```

#### Example Usage
Expand Down
8 changes: 4 additions & 4 deletions exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,28 @@ def cli() -> None:
@cli.command()
@click.option(
"--metrics-port",
help="The port to expose the metrics endpoint on, defaults to 9102.",
type=click.INT,
default=9102,
help="The port to expose the metrics endpoint on.",
)
@click.option(
"--rcon-address",
help="The address for the Factorio server, defaults to localhost.",
type=click.STRING,
help="The address for the Factorio server.",
default="localhost",
required=False,
)
@click.option(
"--rcon-port",
help="The RCON port for the Factorio server, defaults to 27015.",
type=click.INT,
help="The RCON port for the Factorio server.",
default=27015,
required=False,
)
@click.option(
"--rcon-password",
type=click.STRING,
help="The RCON password for the server.",
help="The RCON password for the server, defaults to attempting to read it from the local config.",
required=False,
)
def run(metrics_port: int, rcon_address: str, rcon_port: int, rcon_password: str | None) -> None:
Expand Down

0 comments on commit 9f40e0e

Please sign in to comment.