You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
897 B

use structopt::StructOpt;
mod utils;
use utils::*;
#[test]
fn invisible_group_issue_439() {
macro_rules! m {
($bool:ty) => {
#[derive(Debug, StructOpt)]
struct Opts {
#[structopt(long = "x")]
x: $bool,
}
};
}
m!(bool);
let help = get_long_help::<Opts>();
assert!(help.contains("--x"));
assert!(!help.contains("--x <x>"));
Opts::from_iter_safe(&["test", "--x"]).unwrap();
}
#[test]
fn issue_447() {
macro_rules! Command {
( $name:ident, [
#[$meta:meta] $var:ident($inner:ty)
] ) => {
#[derive(Debug, PartialEq, structopt::StructOpt)]
enum $name {
#[$meta]
$var($inner),
}
};
}
Command! {GitCmd, [
#[structopt(external_subcommand)]
Ext(Vec<String>)
]}
}