summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-05-18 13:25:42 +0200
committerMatthias Beyer <mail@beyermatthias.de>2020-05-18 14:25:41 +0200
commit0717aca15929ff476ac92ec3bf2242943f817a64 (patch)
tree2fda01c02aa7ed0415d567449b1781db500cf8b7 /src/cli.rs
parent7da99d17d2220dcd19f0186c7f44bc34805a2970 (diff)
Split server into subcommand
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 64e011d..1eae246 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -14,6 +14,21 @@ pub struct CLI {
#[structopt(parse(from_os_str))]
configfile: Option<PathBuf>,
+
+ #[structopt(subcommand)]
+ cmd: Option<Command>
+}
+
+impl CLI {
+ pub fn cmd(&self) -> Option<&Command> {
+ self.cmd.as_ref()
+ }
+}
+
+#[derive(Debug, PartialEq, StructOpt)]
+#[structopt(about = "Start the server part (running in foreground")]
+pub enum Command {
+ Server,
}
pub fn cli() -> Result<CLI, Error> {