fn format_sub_usage_string_with_filters(
        &self,
        max_width: Option<usize>,
        leading_spaces: Option<usize>,
        trailing_spaces: Option<usize>,
        filters: Option<Vec<&str>>,
    ) -> String {
        let filters = filters.unwrap_or(vec![]);
        let leading_spaces = leading_spaces.unwrap_or(4);
        let trailing_spaces = trailing_spaces.unwrap_or(4);
        let max_width = max_width.unwrap_or(usize::MAX);

        let mut usage_string = String::from("");

        let flag_usages = self.flag_usages();
        if ! flag_usages.is_empty() {
            let flag_strings = create_usage_lines(
                &flag_usages,
                leading_spaces,
                trailing_spaces,
                max_width,
                &filters,
            );
            usage_string.push_str("FLAGS:\n");
            usage_string.push_str(&flag_strings);
        }

        let arg_usages = self.arg_usages();
        if ! arg_usages.is_empty() {
            // if we have arg usages, AND flag usages
            // make sure theres a newline between them
            if ! flag_usages.is_empty() {
                usage_string.push('\n');
            }

            let arg_strings = create_usage_lines(
                &arg_usages,
                leading_spaces,
                trailing_spaces,
                max_width,
                &filters,
            );
            usage_string.push_str("OPTIONS:\n");
            usage_string.push_str(&arg_strings);
        }

        usage_string
    }
/// same as `format_sub_usage_string`, but allows specifying
/// a vec of filters that will be used to filter out certain
/// flags/options from appearing in the usage string.
/// if a single flag/option matches one of your provided
/// filters, it will not be included in the output string.
same as `format_sub_usage_string`, but allows specifying
a vec of filters that will be used to filter out certain
flags/options from appearing in the usage string.
if a single flag/option matches one of your provided
filters, it will not be included in the output string.
same as ` format_sub_usage_string ` but allows specifying a vec of filters that will be used to filter out certain flags / options from appearing in the usage string . if a single flag / option matches one of your provided filters it will not be included in the output string .
fn format_sub_usage_string_with_filters(
        &self,
        max_width: Option<usize>,
        leading_spaces: Option<usize>,
        trailing_spaces: Option<usize>,
        filters: Option<Vec<&str>>,
    ) -> String {
        let filters = filters.unwrap_or(vec![]);
        let leading_spaces = leading_spaces.unwrap_or(4);
        let trailing_spaces = trailing_spaces.unwrap_or(4);
        let max_width = max_width.unwrap_or(usize::MAX);
        let mut usage_string = String::from("");
        let flag_usages = self.flag_usages();
        if ! flag_usages.is_empty() {
            let flag_strings = create_usage_lines(
                &flag_usages,
                leading_spaces,
                trailing_spaces,
                max_width,
                &filters,
            );
            usage_string.push_str("FLAGS:\n");
            usage_string.push_str(&flag_strings);
        }
        let arg_usages = self.arg_usages();
        if ! arg_usages.is_empty() {
            // if we have arg usages, AND flag usages
            // make sure theres a newline between them
            if ! flag_usages.is_empty() {
                usage_string.push('\n');
            }
            let arg_strings = create_usage_lines(
                &arg_usages,
                leading_spaces,
                trailing_spaces,
                max_width,
                &filters,
            );
            usage_string.push_str("OPTIONS:\n");
            usage_string.push_str(&arg_strings);
        }
        usage_string
    }
fn format_sub_usage_string_with_filters ( & self , max_width : Option < usize > , leading_spaces : Option < usize > , trailing_spaces : Option < usize > , filters : Option < Vec < & str > > , ) -> String { let filters = filters . unwrap_or ( vec ! [ ] ) ; let leading_spaces = leading_spaces . unwrap_or ( 4 ) ; let trailing_spaces = trailing_spaces . unwrap_or ( 4 ) ; let max_width = max_width . unwrap_or ( usize :: MAX ) ; let mut usage_string = String :: from ( " " ) ; let flag_usages = self . flag_usages ( ) ; if ! flag_usages . is_empty ( ) { let flag_strings = create_usage_lines ( & flag_usages , leading_spaces , trailing_spaces , max_width , & filters , ) ; usage_string . push_str ( " \n " ) ; usage_string . push_str ( & flag_strings ) ; } let arg_usages = self . arg_usages ( ) ; if ! arg_usages . is_empty ( ) { // if we have arg usages, AND flag usages // make sure theres a newline between them if ! flag_usages . is_empty ( ) { usage_string . push ( '\n' ) ; } let arg_strings = create_usage_lines ( & arg_usages , leading_spaces , trailing_spaces , max_width , & filters , ) ; usage_string . push_str ( " \n " ) ; usage_string . push_str ( & arg_strings ) ; } usage_string }
same as `format_sub_usage_string`, but allows specifying
a vec of filters that will be used to filter out certain
flags/options from appearing in the usage string.
same as ` format_sub_usage_string ` but allows specifying a vec of filters that will be used to filter out certain flags / options from appearing in the usage string .
&self
max_width
Option<usize>
leading_spaces
Option<usize>
trailing_spaces
Option<usize>
filters
Option<Vec<&str>>
&self
max_width
Option<usize>
leading_spaces
Option<usize>
trailing_spaces
Option<usize>
filters
Option<Vec<&str>>