fn to_clap_app(&self) -> clap::App<'_, '_> {
        let mut app = clap::App::new(&self.name)
            .bin_name(format!("dbdbgen {}", self.name))
            .version(&*self.version)
            .about(&*self.about)
            .settings(&[
                clap::AppSettings::NoBinaryName,
                clap::AppSettings::UnifiedHelpMessage,
                clap::AppSettings::NextLineHelp,
            ]);

        for (name, arg) in &self.args {
            let mut clap_arg = clap::Arg::with_name(name)
                .long(if arg.long.is_empty() { name } else { &arg.long })
                .help(&arg.help);
            if !arg.short.is_empty() {
                clap_arg = clap_arg.short(&arg.short);
            }
            match &arg.r#type {
                ArgType::Bool => {}
                ArgType::Str => {
                    clap_arg = clap_arg.takes_value(true);
                }
                ArgType::Int | ArgType::Float | ArgType::Size => {
                    let t = arg.r#type.clone();
                    clap_arg = clap_arg
                        .takes_value(true)
                        .validator(move |s| t.parse_input(&s).map(drop));
                }
                ArgType::Choices { choices, multiple } => {
                    for choice in choices {
                        clap_arg = clap_arg.possible_value(choice);
                    }
                    if *multiple {
                        clap_arg = clap_arg.required(true).use_delimiter(true).multiple(true);
                    }
                }
            }
            if arg.required {
                clap_arg = clap_arg.required(true);
            }
            if let Some(default) = &arg.default {
                clap_arg = clap_arg.default_value(default);
            }

            app = app.arg(clap_arg);
        }

        app
    }
/// Constructs the clap App from this simplified specification.
Constructs the clap App from this simplified specification.
Constructs the clap App from this simplified specification .
fn to_clap_app(&self) -> clap::App<'_, '_> {
        let mut app = clap::App::new(&self.name)
            .bin_name(format!("dbdbgen {}", self.name))
            .version(&*self.version)
            .about(&*self.about)
            .settings(&[
                clap::AppSettings::NoBinaryName,
                clap::AppSettings::UnifiedHelpMessage,
                clap::AppSettings::NextLineHelp,
            ]);
        for (name, arg) in &self.args {
            let mut clap_arg = clap::Arg::with_name(name)
                .long(if arg.long.is_empty() { name } else { &arg.long })
                .help(&arg.help);
            if !arg.short.is_empty() {
                clap_arg = clap_arg.short(&arg.short);
            }
            match &arg.r#type {
                ArgType::Bool => {}
                ArgType::Str => {
                    clap_arg = clap_arg.takes_value(true);
                }
                ArgType::Int | ArgType::Float | ArgType::Size => {
                    let t = arg.r#type.clone();
                    clap_arg = clap_arg
                        .takes_value(true)
                        .validator(move |s| t.parse_input(&s).map(drop));
                }
                ArgType::Choices { choices, multiple } => {
                    for choice in choices {
                        clap_arg = clap_arg.possible_value(choice);
                    }
                    if *multiple {
                        clap_arg = clap_arg.required(true).use_delimiter(true).multiple(true);
                    }
                }
            }
            if arg.required {
                clap_arg = clap_arg.required(true);
            }
            if let Some(default) = &arg.default {
                clap_arg = clap_arg.default_value(default);
            }
            app = app.arg(clap_arg);
        }
        app
    }
fn to_clap_app ( & self ) -> clap :: App < ' _ , ' _ > { let mut app = clap :: App :: new ( & self . name ) . bin_name ( format ! ( " " self name ) ) . version ( & * self . version ) . about ( & * self . about ) . settings ( & [ clap :: AppSettings :: NoBinaryName , clap :: AppSettings :: UnifiedHelpMessage , clap :: AppSettings :: NextLineHelp , ] ) ; for ( name , arg ) in & self . args { let mut clap_arg = clap :: Arg :: with_name ( name ) . long ( if arg . long . is_empty ( ) { name } else { & arg . long } ) . help ( & arg . help ) ; if ! arg . short . is_empty ( ) { clap_arg = clap_arg . short ( & arg . short ) ; } match & arg . r#type { ArgType :: Bool => { } ArgType :: Str => { clap_arg = clap_arg . takes_value ( true ) ; } ArgType :: Int | ArgType :: Float | ArgType :: Size => { let t = arg . r#type . clone ( ) ; clap_arg = clap_arg . takes_value ( true ) . validator ( move | s | t . parse_input ( & s ) . map ( drop ) ) ; } ArgType :: Choices { choices , multiple } => { for choice in choices { clap_arg = clap_arg . possible_value ( choice ) ; } if * multiple { clap_arg = clap_arg . required ( true ) . use_delimiter ( true ) . multiple ( true ) ; } } } if arg . required { clap_arg = clap_arg . required ( true ) ; } if let Some ( default ) = & arg . default { clap_arg = clap_arg . default_value ( default ) ; } app = app . arg ( clap_arg ) ; } app }
Constructs the clap App from this simplified specification.
Constructs the clap App from this simplified specification .
&self
&self