Skip to content

arti-relay: add clap for cli

opara requested to merge opara/arti:relay-bin-2 into main

Part of #1736.

This adds a very basic cli interface, with options inspired by the arti cli interface. The config file paths are temporary until we have #1673 solved.

The flags aren't hooked up to anything yet, but I figured I'd make this into a MR to try to keep the MRs small.

This adds two subcommands: "run" and "build-info".

The "build-info" command would be useful for when people submit bug reports, and the output looks like:

Version: 0.24.0
Features: default,rustls,tokio
Profile: debug
Debug: true
Optimization level: 0
Rust version: rustc 1.82.0 (f6e511eec 2024-10-15)
Target triple: x86_64-unknown-linux-gnu
Host triple: x86_64-unknown-linux-gnu

Current --help text:

A Rust Tor relay implementation

Usage: arti-relay [OPTIONS] <COMMAND>

Commands:
  run         Run the relay
  build-info  Print build information
  help        Print this message or the help of the given subcommand(s)

Options:
  -l, --log-level <LEVEL>             Log level [default: info] [possible values: error, warn, info, debug, trace]
      --disable-fs-permission-checks  Don't check permissions on the files we use
  -o, --option <KEY=VALUE>            Override config file parameters, using TOML-like syntax
  -c, --config <FILE>                 Config file(s) to read [default: ~/.config/arti-relay/arti-relay.toml ~/.config/arti-relay/arti-relay.d/]
  -h, --help                          Print help
  -V, --version                       Print version
Edited by opara

Merge request reports

Loading