chiark / gitweb /
wip clap
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Aug 2020 23:48:37 +0000 (00:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Aug 2020 23:48:37 +0000 (00:48 +0100)
src/bin/otter.rs

index 3582bf3fa2cb62a2cd5832b7259d545c911eab37..628dcd8c5255a24cbeefa4551a1f1c78df145f4d 100644 (file)
@@ -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<String>,
+  #[structopt(subcommand)]
+  cmd: Subcommand,
+}
+
+#[derive(Debug,StructOpt)]
+enum Subcommand {
+  CreateTable {
+  }
 }
 
-fn main() { todo!() }
+fn main() {
+  let opts = MainOpts::from_args();
+  println!("{:?}", &opts);
+}