oa_gateway::cli

Function parse_args

Source
pub(crate) fn parse_args<I>(args: I) -> Result<Cli, String>
where I: IntoIterator<Item = String>,
Expand description

Parses command-line arguments after the program name.

A single positional path means run. -h/--help and -V/--version win immediately. Anything else that looks like a flag is rejected so it is not mistaken for a config path.

ยงErrors

Returns an error if a flag is unknown, a second positional argument is present, or no config path was given.