git-next/src/main.rs

42 lines
842 B
Rust
Raw Normal View History

mod filesystem;
mod init;
mod server;
2024-04-06 18:26:08 +01:00
use clap::Parser;
#[derive(Parser, Debug)]
#[clap(version = clap::crate_version!(), author = clap::crate_authors!(), about = clap::crate_description!())]
struct Commands {
#[clap(subcommand)]
command: Command,
}
#[derive(Parser, Debug)]
enum Command {
Init,
#[clap(subcommand)]
Server(Server),
}
#[derive(Parser, Debug)]
enum Server {
Init,
Start,
}
2024-04-06 17:39:56 +01:00
fn main() {
let fs = filesystem::FileSystem::new_real(None);
2024-04-06 18:26:08 +01:00
let commands = Commands::parse();
match commands.command {
Command::Init => {
init::run(fs);
2024-04-06 18:26:08 +01:00
}
Command::Server(server) => match server {
Server::Init => {
server::init(fs);
2024-04-06 18:26:08 +01:00
}
Server::Start => {
server::start(fs);
2024-04-06 18:26:08 +01:00
}
},
}
2024-04-06 17:39:56 +01:00
}