feat(init): init command
This commit is contained in:
20
src/subcommands/init.rs
Normal file
20
src/subcommands/init.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use clap::{Arg, ArgMatches, Command};
|
||||
|
||||
use crate::commands;
|
||||
use crate::config::config::Config;
|
||||
|
||||
pub fn create() -> Command {
|
||||
Command::new("init")
|
||||
.arg(
|
||||
Arg::new("directory")
|
||||
.required(false)
|
||||
.num_args(1)
|
||||
.value_name("DIRECTORY"),
|
||||
)
|
||||
.about("Create an empty Nextsync repository")
|
||||
}
|
||||
|
||||
pub fn handler(args: &ArgMatches) {
|
||||
let exec_dir = args.get_one::<String>("directory");
|
||||
commands::init::exec(commands::init::InitArgs {}, Config::new(exec_dir));
|
||||
}
|
||||
Reference in New Issue
Block a user