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); }