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 disable_help_subcommand = true,
18 long_about = "连接到 futu-opend 网关,查询行情 / 订阅推送 / 交易。"
19)]
20pub struct Cli {
21 #[arg(
23 short,
24 long,
25 global = true,
26 env = "FUTU_GATEWAY",
27 default_value = "127.0.0.1:11111"
28 )]
29 pub gateway: String,
30
31 #[arg(short, long, global = true, value_enum, default_value_t = OutputFormat::Table)]
33 pub output: OutputFormat,
34
35 #[arg(short, long, global = true)]
37 pub verbose: bool,
38
39 #[arg(long, global = true)]
51 pub audit_log: Option<std::path::PathBuf>,
52
53 #[command(subcommand)]
54 pub command: Command,
55}
56
57mod commands;
58pub use commands::Command;
59
60#[cfg(test)]
61mod tests;
62
63mod dispatch;
64pub use dispatch::dispatch;