use super::APPLET_TEMPLATE;
pub fn command() -> clap::Command {
clap::Command::new("job")
.about("subcommand job")
.subcommand(
clap::Command::new("ls")
.about("List all the job ids")
)
.subcommand(
clap::Command::new("show")
.about("print a job report")
.arg(
clap::Arg::new("id")
.short('i')
.long("id")
.help("job id, prefix acceptable")
.required(true)
)
)
.help_template(APPLET_TEMPLATE)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_command() {
let cmd_1 = command();
let res_1 = cmd_1.try_get_matches_from(vec!["job", "ls"]);
assert!(res_1.is_ok());
let cmd_2 = command();
let res_2 = cmd_2.try_get_matches_from(vec!["ds", "show", "--id", "job_id"]);
assert!(res_2.is_ok());
}
}