Paul Campbell
f255c44dfa
The filesystem, and the intended network module have been extracted into their own library as they are used by more than one project, so they can now be developed independently and updates shared. Closes kemitix/git-next#9
41 lines
848 B
Rust
41 lines
848 B
Rust
mod init;
|
|
mod server;
|
|
|
|
use clap::Parser;
|
|
use kxio::filesystem;
|
|
|
|
#[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,
|
|
}
|
|
fn main() {
|
|
let fs = filesystem::FileSystem::new_real(None);
|
|
let commands = Commands::parse();
|
|
|
|
match commands.command {
|
|
Command::Init => {
|
|
init::run(fs);
|
|
}
|
|
Command::Server(server) => match server {
|
|
Server::Init => {
|
|
server::init(fs);
|
|
}
|
|
Server::Start => {
|
|
server::start(fs);
|
|
}
|
|
},
|
|
}
|
|
}
|