1use clap::{Args, Parser, Subcommand};
2use std::path::PathBuf;
3
4#[derive(Debug, Parser)]
5#[command(name = "discord-proxy")]
6#[command(about = "Start Discord with a process-local proxy")]
7pub struct Cli {
8 #[arg(short, long, global = true, value_name = "FILE")]
9 pub config: Option<PathBuf>,
10
11 #[command(subcommand)]
12 pub command: Commands,
13}
14
15#[derive(Debug, Subcommand)]
16pub enum Commands {
17 Launch(LaunchArgs),
19 Doctor(DoctorArgs),
21 Bridge(BridgeArgs),
23}
24
25#[derive(Debug, Args)]
26pub struct LaunchArgs {
27 #[arg(short, long)]
29 pub proxy: Option<String>,
30
31 #[arg(long)]
33 pub channel: Option<String>,
34
35 #[arg(long, value_name = "DIR")]
37 pub discord_dir: Option<PathBuf>,
38
39 #[arg(long)]
41 pub listen_port: Option<u16>,
42
43 #[arg(long)]
45 pub no_bridge: bool,
46
47 #[arg(long)]
49 pub dry_run: bool,
50}
51
52#[derive(Debug, Args)]
53pub struct DoctorArgs {
54 #[arg(long)]
56 pub channel: Option<String>,
57
58 #[arg(long, value_name = "DIR")]
60 pub discord_dir: Option<PathBuf>,
61}
62
63#[derive(Debug, Args)]
64pub struct BridgeArgs {
65 #[arg(short, long)]
67 pub proxy: String,
68
69 #[arg(long)]
71 pub listen_port: Option<u16>,
72}