pub trait CommandLineParserTraitConst {
    // Required method
    fn as_raw_CommandLineParser(&self) -> *const c_void;

    // Provided methods
    fn get_path_to_application(&self) -> Result<String> { ... }
    fn has(&self, name: &str) -> Result<bool> { ... }
    fn check(&self) -> Result<bool> { ... }
    fn print_message(&self) -> Result<()> { ... }
    fn print_errors(&self) -> Result<()> { ... }
}
Expand description

Constant methods for core::CommandLineParser

Required Methods§

Provided Methods§

source

fn get_path_to_application(&self) -> Result<String>

Returns application path

This method returns the path to the executable from the command line (argv[0]).

For example, if the application has been started with such a command:

$ ./bin/my-executable

this method will return ./bin.

source

fn has(&self, name: &str) -> Result<bool>

Check if field was provided in the command line

Parameters
  • name: argument name to check
source

fn check(&self) -> Result<bool>

Check for parsing errors

Returns false if error occurred while accessing the parameters (bad conversion, missing arguments, etc.). Call [printErrors] to print error messages list.

source

fn print_message(&self) -> Result<()>

Print help message

This method will print standard help message containing the about message and arguments description.

See also

about

source

fn print_errors(&self) -> Result<()>

Print list of errors occurred

See also

check

Implementors§