Files
nextsync-rust/src/subcommands/status.rs
2024-03-31 22:17:26 +02:00

31 lines
760 B
Rust

use clap::{Arg, Command, ArgMatches};
use crate::global;
use crate::commands;
use crate::commands::status::StatusArgs;
pub fn create() -> Command {
Command::new("status")
.arg(
Arg::new("directory")
.num_args(1)
.value_name("DIRECTORY")
)
.arg(
Arg::new("nostyle")
.long("nostyle")
.help("Status with minium information and style"),
)
.about("Show the working tree status")
}
pub fn handler(args: &ArgMatches) {
if let Some(val) = args.get_one::<String>("directory") {
global::global::set_dir_path(val.to_string());
}
commands::status::status(StatusArgs {
nostyle: args.contains_id("nostyle"),
});
}