1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use clap::Parser;
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(
name = "gpur",
version,
about = "btop-style GPU monitor — NVIDIA, AMD, Apple Silicon",
before_help = include_str!("art.txt")
)]
pub struct Cli {
/// Use deterministic mock GPUs (demo the UI without hardware).
/// Optionally pass how many, e.g. `--mock 6`.
#[arg(long, num_args = 0..=1, default_missing_value = "2", value_name = "N")]
pub mock: Option<usize>,
/// Path to config.toml (default: $XDG_CONFIG_HOME/gpur/config.toml)
#[arg(long, short)]
pub config: Option<PathBuf>,
/// Path to a theme TOML (overrides the config file)
#[arg(long, short)]
pub theme: Option<PathBuf>,
/// Poll interval in milliseconds (overrides the config file)
#[arg(long)]
pub tick_ms: Option<u64>,
/// Skip the startup splash
#[arg(long)]
pub no_splash: bool,
/// Print one snapshot (two quick polls so utilization deltas are real)
/// and exit — no TUI
#[arg(long)]
pub once: bool,
/// Like --once but machine-readable JSON on stdout
#[arg(long)]
pub json: bool,
/// Graph glyph set (overrides config `graphs`); ascii for terminals
/// without braille/block fonts
#[arg(long, value_enum)]
pub graphs: Option<crate::app::GraphStyle>,
/// Append one JSON line per poll to this file (sensor logging)
#[arg(long, value_name = "FILE")]
pub log: Option<PathBuf>,
}