1use clap::Parser;
8
9use crate::output::OutputFormat;
10
11#[derive(Parser)]
13#[command(
14 name = "futucli",
15 version,
16 about = "FutuOpenD-rs command-line client",
17 long_about = "连接到 futu-opend 网关,查询行情 / 订阅推送 / 交易。"
18)]
19pub struct Cli {
20 #[arg(
22 short,
23 long,
24 global = true,
25 env = "FUTU_GATEWAY",
26 default_value = "127.0.0.1:11111"
27 )]
28 pub gateway: String,
29
30 #[arg(short, long, global = true, value_enum, default_value_t = OutputFormat::Table)]
32 pub output: OutputFormat,
33
34 #[arg(short, long, global = true)]
36 pub verbose: bool,
37
38 #[arg(long, global = true)]
50 pub audit_log: Option<std::path::PathBuf>,
51
52 #[command(subcommand)]
53 pub command: Command,
54}
55
56mod commands;
57pub use commands::Command;
58
59#[cfg(test)]
60mod tests;
61
62mod dispatch;
63pub use dispatch::dispatch;