argh icon indicating copy to clipboard operation
argh copied to clipboard

`from_env` example usage

Open 89z opened this issue 4 years ago • 1 comments

If you look at the example here:

https://github.com/google/argh#basic-example

it ends with this:

let up: GoUp = argh::from_env();

but it doesnt show you how to actually use the result of the parsing. If you look at from_env:

https://docs.rs/argh/0.1.3/argh/fn.from_env.html

I think it returns a TopLevelCommand:

https://docs.rs/argh/0.1.3/argh/trait.TopLevelCommand.html

which seems to be alias for FromArgs:

https://docs.rs/argh/0.1.3/argh/trait.FromArgs.html

which seems to return a Result<Self, EarlyExit>. At that point I am stuck, as I dont know what Self is, or how to utilize it.

89z avatar Nov 09 '20 00:11 89z