fn help(&mut self, arg: &Arg<'c>, spec_vals: &str, prevent_nlh: bool) -> io::Result<()> {
        debug!("Help::help");
        let h = if self.use_long {
            arg.long_help.unwrap_or_else(|| arg.help.unwrap_or(""))
        } else {
            arg.help.unwrap_or_else(|| arg.long_help.unwrap_or(""))
        };
        let mut help = String::from(h) + spec_vals;
        let nlh = self.next_line_help || arg.is_set(ArgSettings::NextLineHelp) || self.use_long;
        debug!("Help::help: Next Line...{:?}", nlh);

        let spcs = if nlh || self.force_next_line {
            12 // "tab" * 3
        } else {
            self.longest + 12
        };

        let too_long = spcs + str_width(h) + str_width(&*spec_vals) >= self.term_w;

        // Is help on next line, if so then indent
        if nlh || self.force_next_line {
            self.none(&format!("\n{}{}{}", TAB, TAB, TAB))?;
        }

        debug!("Help::help: Too long...");
        if too_long && spcs <= self.term_w {
            debug!("Yes");
            debug!("Help::help: help...{}", help);
            debug!("Help::help: help width...{}", str_width(&*help));
            // Determine how many newlines we need to insert
            let avail_chars = self.term_w - spcs;
            debug!("Help::help: Usable space...{}", avail_chars);
            help = wrap_help(&help, avail_chars);
        } else {
            debug!("No");
        }
        if let Some(part) = help.lines().next() {
            self.none(part)?;
        }
        for part in help.lines().skip(1) {
            self.none("\n")?;
            if nlh || self.force_next_line {
                self.none(&format!("{}{}{}", TAB, TAB, TAB))?;
            } else if arg.has_switch() {
                write_nspaces!(self, self.longest + 12);
            } else {
                write_nspaces!(self, self.longest + 8);
            }
            self.none(part)?;
        }
        if !prevent_nlh && !help.contains('\n') && (nlh || self.force_next_line) {
            self.none("\n")?;
        }
        Ok(())
    }
/// Writes argument's help to the wrapped stream.
Writes argument's help to the wrapped stream.
Writes argument ' s help to the wrapped stream .
fn help(&mut self, arg: &Arg<'c>, spec_vals: &str, prevent_nlh: bool) -> io::Result<()> {
        debug!("Help::help");
        let h = if self.use_long {
            arg.long_help.unwrap_or_else(|| arg.help.unwrap_or(""))
        } else {
            arg.help.unwrap_or_else(|| arg.long_help.unwrap_or(""))
        };
        let mut help = String::from(h) + spec_vals;
        let nlh = self.next_line_help || arg.is_set(ArgSettings::NextLineHelp) || self.use_long;
        debug!("Help::help: Next Line...{:?}", nlh);
        let spcs = if nlh || self.force_next_line {
            12 // "tab" * 3
        } else {
            self.longest + 12
        };
        let too_long = spcs + str_width(h) + str_width(&*spec_vals) >= self.term_w;
        // Is help on next line, if so then indent
        if nlh || self.force_next_line {
            self.none(&format!("\n{}{}{}", TAB, TAB, TAB))?;
        }
        debug!("Help::help: Too long...");
        if too_long && spcs <= self.term_w {
            debug!("Yes");
            debug!("Help::help: help...{}", help);
            debug!("Help::help: help width...{}", str_width(&*help));
            // Determine how many newlines we need to insert
            let avail_chars = self.term_w - spcs;
            debug!("Help::help: Usable space...{}", avail_chars);
            help = wrap_help(&help, avail_chars);
        } else {
            debug!("No");
        }
        if let Some(part) = help.lines().next() {
            self.none(part)?;
        }
        for part in help.lines().skip(1) {
            self.none("\n")?;
            if nlh || self.force_next_line {
                self.none(&format!("{}{}{}", TAB, TAB, TAB))?;
            } else if arg.has_switch() {
                write_nspaces!(self, self.longest + 12);
            } else {
                write_nspaces!(self, self.longest + 8);
            }
            self.none(part)?;
        }
        if !prevent_nlh && !help.contains('\n') && (nlh || self.force_next_line) {
            self.none("\n")?;
        }
        Ok(())
    }
fn help ( & mut self , arg : & Arg < ' c > , spec_vals : & str , prevent_nlh : bool ) -> io :: Result < ( ) > { debug ! ( " " ) ; let h = if self . use_long { arg . long_help . unwrap_or_else ( | | arg . help . unwrap_or ( " " ) ) } else { arg . help . unwrap_or_else ( | | arg . long_help . unwrap_or ( " " ) ) } ; let mut help = String :: from ( h ) + spec_vals ; let nlh = self . next_line_help || arg . is_set ( ArgSettings :: NextLineHelp ) || self . use_long ; debug ! ( " " nlh ) ; let spcs = if nlh || self . force_next_line { 12 // "tab" * 3 } else { self . longest + 12 } ; let too_long = spcs + str_width ( h ) + str_width ( & * spec_vals ) >= self . term_w ; // Is help on next line, if so then indent if nlh || self . force_next_line { self . none ( & format ! ( " \n " TAB TAB TAB ) ) ? ; } debug ! ( " " ) ; if too_long && spcs <= self . term_w { debug ! ( " " ) ; debug ! ( " " help ) ; debug ! ( " " str_width ( help ) ) ; // Determine how many newlines we need to insert let avail_chars = self . term_w - spcs ; debug ! ( " " avail_chars ) ; help = wrap_help ( & help , avail_chars ) ; } else { debug ! ( " " ) ; } if let Some ( part ) = help . lines ( ) . next ( ) { self . none ( part ) ? ; } for part in help . lines ( ) . skip ( 1 ) { self . none ( " \n " ) ? ; if nlh || self . force_next_line { self . none ( & format ! ( " " TAB TAB TAB ) ) ? ; } else if arg . has_switch ( ) { write_nspaces ! ( self self longest 12 ) ; } else { write_nspaces ! ( self self longest 8 ) ; } self . none ( part ) ? ; } if ! prevent_nlh && ! help . contains ( '\n' ) && ( nlh || self . force_next_line ) { self . none ( " \n " ) ? ; } Ok ( ( ) ) }
Writes argument's help to the wrapped stream.
Writes argument ' s help to the wrapped stream .
&mut self
arg
&Arg<'c>
spec_vals
&str
prevent_nlh
bool
&mut self
arg
&Arg<'c>
spec_vals
&str
prevent_nlh
bool