[−][src]Function sc_cli::from_iter
pub fn from_iter<T, I>(iter: I, version: &VersionInfo) -> T where
T: StructOpt + Sized,
I: IntoIterator,
I::Item: Into<OsString> + Clone,
Helper function used to parse the command line arguments. This is the equivalent of
structopt
's from_iter()
except that it takes a VersionInfo
argument to provide the name of
the application, author, "about" and version. It will also set AppSettings::GlobalVersion
.
To allow running the node without subcommand, tt also sets a few more settings:
AppSettings::ArgsNegateSubcommands
and AppSettings::SubcommandsNegateReqs
.
Gets the struct from any iterator such as a Vec
of your making.
Print the error message and quit the program in case of failure.