aboutsummaryrefslogtreecommitdiff
path: root/src/cli/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/mod.rs')
-rw-r--r--src/cli/mod.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
new file mode 100644
index 0000000..c656c1c
--- /dev/null
+++ b/src/cli/mod.rs
@@ -0,0 +1,23 @@
+use structopt::StructOpt;
+
+use crate::{Settings, UrlMap};
+
+mod run_server;
+
+#[derive(StructOpt)]
+enum Command {
+ RunServer(run_server::RunServer),
+}
+
+impl Command {
+ fn execute(self, urls: UrlMap, settings: Settings) {
+ match self {
+ Command::RunServer(command) => command.execute(urls, settings),
+ }
+ }
+}
+
+pub fn main(urls: UrlMap, settings: Settings) {
+ let command = Command::from_args();
+ command.execute(urls, settings);
+}