Struct app::Helper [] [src]

pub struct Helper { /* fields omitted */ }

Helper

Methods

impl Helper
[src]

[src]

name

[src]

version

[src]

description

[src]

name, email

[src]

url_name, url

impl Helper
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

You can do something if the length of arguments satisfys a condition.

Example: Print the help message when args.len() is 0.

let helper= {
    ...
};
if helper.args_len() == 0 
{
    helper.help_exit(0);
}

[src]

[src]

impl Helper
[src]

[src]

exit with the status

[src]

format!("{} {}", self.name(), self.version())

[src]

print ver(self.ver) message and exit with the status

[src]

format!("ERROR:\n {}\n\n", error)

[src]

print error(self.err(error)) message to stderr and exit with the status

[src]

print error message line(2) with Red color(fg)

[src]

main's help mesage

[src]

print main's help message and exit with the status

[src]

self.err(error) + self.help()

[src]

print error and help message(self.help_err(error)) to stderr and exit with the status

[src]

get sub_command's help message

[src]

print sub_command's help message and exit with the status

[src]

self.err(error) + self.help_cmd(cmd_name)

[src]

print error and sub_command's help message to stderr,s exit with the status

Trait Implementations

impl Debug for Helper
[src]

[src]

Formats the value using the given formatter.

impl Default for Helper
[src]

[src]

Returns the "default value" for a type. Read more