pub(crate) fn parse_and_execute_single_command<E, W: Write>(
    program: &str,
    args: &[String],
    command: Command<E>,
    output_writer: Option<W>,
) -> Result<Option<CommandResult<E>>> {
    let args: Vec<String> = Some(command.name.clone())
        .into_iter()
        .chain(args.iter().cloned())
        .collect();
    parse_and_execute_impl(
        program,
        args.as_slice(),
        vec![command],
        output_writer,
        false,
        false,
    )
}
/// This function parses the given program parameters and calls the given
/// command's callback. It prints out usage information if the parameters are
/// invalid, and returns a reasonable exit code for the process.
///
/// This is the function which should be used for typical single-command
/// programs.
This function parses the given program parameters and calls the given
command's callback. It prints out usage information if the parameters are
invalid, and returns a reasonable exit code for the process.

This is the function which should be used for typical single-command
programs.
This function parses the given program parameters and calls the given command ' s callback . It prints out usage information if the parameters are invalid and returns a reasonable exit code for the process . This is the function which should be used for typical single - command programs .
pub(crate) fn parse_and_execute_single_command<E, W: Write>(
    program: &str,
    args: &[String],
    command: Command<E>,
    output_writer: Option<W>,
) -> Result<Option<CommandResult<E>>> {
    let args: Vec<String> = Some(command.name.clone())
        .into_iter()
        .chain(args.iter().cloned())
        .collect();
    parse_and_execute_impl(
        program,
        args.as_slice(),
        vec![command],
        output_writer,
        false,
        false,
    )
}
pub ( crate ) fn parse_and_execute_single_command < E , W : Write > ( program : & str , args : & [ String ] , command : Command < E > , output_writer : Option < W > , ) -> Result < Option < CommandResult < E > > > { let args : Vec < String > = Some ( command . name . clone ( ) ) . into_iter ( ) . chain ( args . iter ( ) . cloned ( ) ) . collect ( ) ; parse_and_execute_impl ( program , args . as_slice ( ) , vec ! [ command ] , output_writer , false , false , ) }
This function parses the given program parameters and calls the given
command's callback.
This function parses the given program parameters and calls the given command ' s callback .
program
&str
args
&[String]
command
Command<E>
output_writer
Option<W>
program
&str
args
&[String]
command
Command<E>
output_writer
Option<W>