Struct app::App [] [src]

pub struct App<'app> { /* fields omitted */ }

Application

Methods

impl<'app> App<'app>
[src]

[src]

name

[src]

version

[src]

discription

[src]

name, email

[src]

url_name, url

[src]

add a Opt

[src]

get arguments

[src]

add a sub_command

[src]

allow env::args().count() == 1

deafult: true

impl<'app> App<'app>
[src]

[src]

build Helper for custom Helps

You can modify Helps.xxx by app.as_mut_helps()

[src]

[src]

parse(std::env::args()[1..]) and exit(1) if parse fails.

[src]

parse(&[String]) and exit(1) if parse fails.

[src]

[src]

impl<'app> App<'app>
[src]

About Cargo

If the binary being calling as subcommand by cargo,

You should call fix_helps_for_cargo() and use parse_args_for_cargo() to replace parse_args().

You could see the example: cargo-http

Notice:

If Your App's name is xxx, Your crate's name have to name like cargo-xxx,

and you can install it by cargo intsall,

you can call it by cargo xxx or cargo-xxx(If it's path in the path environment variable, but is not recommended),

if you want to call it by xxx, you can use ln or cp command.

ln -s $HOME/.cargo/bin/cargo-xxx  $HOME/.cargo/bin/xxx

or

sudo ln -s $HOME/.cargo/bin/cargo-xxx  /usr/bin/xxx

[src]

This function is only verified on Linux/Windows(cargo-V0.23.0) currently.

[src]

[src]

parse(std::env::args()[2..]) and exit(1) if parse fails.

Trait Implementations

impl<'app> Debug for App<'app>
[src]

[src]

Formats the value using the given formatter.

impl<'app> Default for App<'app>
[src]

[src]

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