mod argument;
mod command;
mod options;
mod terminator;
mod validations;
use super::*;
#[test]
fn _0001() {
let expected = r#"
Usage: clars
"#;
let matches = Clar::new(APP).resolve(EMPTY_INPUT).unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0002() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
-c
"#;
let matches = Clar::new(APP).options([ClarOption::short("color", 'c')]).resolve(EMPTY_INPUT).unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0003() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
--color
"#;
let matches = Clar::new(APP).options([ClarOption::long("color", "color")]).resolve(EMPTY_INPUT).unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0004() {
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c').help("Coloring").help_long("Beautiful coloring")])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(
r#"
Usage: clars [OPTIONS]
Options:
-c Coloring
"#,
matches.get_help(),
);
eq_text(
r#"
Usage: clars [OPTIONS]
Options:
-c Beautiful coloring
"#,
matches.get_help_long(),
);
}
#[test]
fn _0005() {
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c').help_long("Coloring")])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(
r#"
Usage: clars [OPTIONS]
Options:
-c
"#,
matches.get_help(),
);
eq_text(
r#"
Usage: clars [OPTIONS]
Options:
-c Coloring
"#,
matches.get_help_long(),
);
}
#[test]
fn _0006() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
-c <WHEN> [default: always]
"#;
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c').takes_value("WHEN").default_value("always")])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0007() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
-c [<WHEN>] [implicit: never]
"#;
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c').takes_value("WHEN").default_missing_value("never")])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0008() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
-c <WHEN> [possible values: auto, always, never]
"#;
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c').takes_value("WHEN").possible_values(["auto", "always", "never"])])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0009() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
-c [<WHEN>] [default: auto] [implicit: always]
"#;
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c')
.takes_value("WHEN")
.default_value("auto")
.default_missing_value("always")])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0010() {
let expected = r#"
Usage: clars [OPTIONS]
Options:
-c [<WHEN>] [default: auto] [implicit: always] [possible values: auto, always, never]
"#;
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c')
.takes_value("WHEN")
.default_value("auto")
.default_missing_value("always")
.possible_values(["auto", "always", "never"])])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(expected, matches.get_help());
eq_text(expected, matches.get_help_long());
}
#[test]
fn _0011() {
let matches = Clar::new(APP)
.options([ClarOption::short("color", 'c')
.takes_value("WHEN")
.default_value("auto")
.default_missing_value("always")
.possible_values(["auto", "always", "never"])
.help("Coloring")
.help_long("Beautiful coloring")])
.resolve(EMPTY_INPUT)
.unwrap();
eq_text(
r#"
Usage: clars [OPTIONS]
Options:
-c [<WHEN>] Coloring [default: auto] [implicit: always] [possible values: auto, always, never]
"#,
matches.get_help(),
);
eq_text(
r#"
Usage: clars [OPTIONS]
Options:
-c [<WHEN>] Beautiful coloring
[default: auto] [implicit: always] [possible values: auto, always, never]
"#,
matches.get_help_long(),
);
}