From: Ian Jackson Date: Tue, 4 Aug 2020 23:48:37 +0000 (+0100) Subject: wip clap X-Git-Tag: otter-0.2.0~1181 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d5420d7c1f8246a79b17875bbe52e73f6af29bd0;p=otter.git wip clap --- diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 3582bf3f..628dcd8c 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -1,7 +1,24 @@ // -fn create_table() { - +use structopt::StructOpt; + +#[derive(Debug,StructOpt)] +#[structopt(rename_all="kebab-case")] +struct MainOpts { + #[structopt(long,group="scope",overrides_with("scope"))] server_scope: bool, + #[structopt(long,group="scope",overrides_with("scope"))] unix: bool, + #[structopt(long,group="scope",overrides_with("scope"))] unix_user: Option, + #[structopt(subcommand)] + cmd: Subcommand, +} + +#[derive(Debug,StructOpt)] +enum Subcommand { + CreateTable { + } } -fn main() { todo!() } +fn main() { + let opts = MainOpts::from_args(); + println!("{:?}", &opts); +}