use clap::{Command, Arg, ArgMatches, ArgAction};
pub fn get_matches() -> ArgMatches {
Command::new(crate_name!())
.version(crate_version!())
.author(crate_authors!())
.about(crate_description!())
.arg_required_else_help(true)
.subcommand(Command::new("add")
.about("Add server space config"))
.subcommand(Command::new("list").
about("List server space config"))
.subcommand(Command::new("detail")
.about("Print server space config detail")
.arg(Arg::new("space_name")
.value_parser(value_parser!(String))
.action(ArgAction::Set)
.required(true)
)
)
.subcommand(Command::new("remove")
.about("Remove server space config")
.arg(Arg::new("space_name")
.value_parser(value_parser!(String))
.action(ArgAction::Set)
.required(true)
.help("server space name")
)
)
.subcommand(Command::new("push")
.about("Push the specified directory under the current directory to the server")
.arg(Arg::new("pushed_dir")
.value_parser(value_parser!(String))
.action(ArgAction::Set)
.required(true)
.help("to be pushed dir"))
.arg(Arg::new("space_name")
.value_parser(value_parser!(String))
.action(ArgAction::Set)
.required(true)))
.subcommand(Command::new("rmrf")
.about("Delete all dirs and files in the specified server space")
.arg(Arg::new("space_name")
.value_parser(value_parser!(String))
.action(ArgAction::Set)
.required(true)
.help("server space name")))
.get_matches()
}