From d5420d7c1f8246a79b17875bbe52e73f6af29bd0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 5 Aug 2020 00:48:37 +0100 Subject: [PATCH] wip clap --- src/bin/otter.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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); +} -- 2.30.2