fn from_iter<I>(iter: I) -> Self
	where
		Self: StructOpt + Sized,
		I: IntoIterator,
		I::Item: Into<std::ffi::OsString> + Clone,
	{
		let app = <Self as StructOpt>::clap();

		let mut full_version = Self::impl_version();
		full_version.push_str("\n");

		let name = Self::executable_name();
		let author = Self::author();
		let about = Self::description();
		let app = app
			.name(name)
			.author(author.as_str())
			.about(about.as_str())
			.version(full_version.as_str())
			.settings(&[
				AppSettings::GlobalVersion,
				AppSettings::ArgsNegateSubcommands,
				AppSettings::SubcommandsNegateReqs,
			]);

		let matches = match app.get_matches_from_safe(iter) {
			Ok(matches) => matches,
			Err(mut e) => {
				// To support pipes, we can not use `writeln!` as any error
				// results in a "broken pipe" error.
				//
				// Instead we write directly to `stdout` and ignore any error
				// as we exit afterwards anyway.
				e.message.extend("\n".chars());

				if e.use_stderr() {
					let _ = std::io::stderr().write_all(e.message.as_bytes());
					std::process::exit(1);
				} else {
					let _ = std::io::stdout().write_all(e.message.as_bytes());
					std::process::exit(0);
				}
			},
		};

		<Self as StructOpt>::from_clap(&matches)
	}
/// 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, it 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.
Helper function used to parse the command line arguments.



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.
Helper function used to parse the command line arguments . 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 .
fn from_iter<I>(iter: I) -> Self
	where
		Self: StructOpt + Sized,
		I: IntoIterator,
		I::Item: Into<std::ffi::OsString> + Clone,
	{
		let app = <Self as StructOpt>::clap();
		let mut full_version = Self::impl_version();
		full_version.push_str("\n");
		let name = Self::executable_name();
		let author = Self::author();
		let about = Self::description();
		let app = app
			.name(name)
			.author(author.as_str())
			.about(about.as_str())
			.version(full_version.as_str())
			.settings(&[
				AppSettings::GlobalVersion,
				AppSettings::ArgsNegateSubcommands,
				AppSettings::SubcommandsNegateReqs,
			]);
		let matches = match app.get_matches_from_safe(iter) {
			Ok(matches) => matches,
			Err(mut e) => {
				// To support pipes, we can not use `writeln!` as any error
				// results in a "broken pipe" error.
				//
				// Instead we write directly to `stdout` and ignore any error
				// as we exit afterwards anyway.
				e.message.extend("\n".chars());
				if e.use_stderr() {
					let _ = std::io::stderr().write_all(e.message.as_bytes());
					std::process::exit(1);
				} else {
					let _ = std::io::stdout().write_all(e.message.as_bytes());
					std::process::exit(0);
				}
			},
		};
		<Self as StructOpt>::from_clap(&matches)
	}
fn from_iter < I > ( iter : I ) -> Self where Self : StructOpt + Sized , I : IntoIterator , I :: Item : Into < std :: ffi :: OsString > + Clone , { let app = < Self as StructOpt > :: clap ( ) ; let mut full_version = Self :: impl_version ( ) ; full_version . push_str ( " \n " ) ; let name = Self :: executable_name ( ) ; let author = Self :: author ( ) ; let about = Self :: description ( ) ; let app = app . name ( name ) . author ( author . as_str ( ) ) . about ( about . as_str ( ) ) . version ( full_version . as_str ( ) ) . settings ( & [ AppSettings :: GlobalVersion , AppSettings :: ArgsNegateSubcommands , AppSettings :: SubcommandsNegateReqs , ] ) ; let matches = match app . get_matches_from_safe ( iter ) { Ok ( matches ) => matches , Err ( mut e ) => { // To support pipes, we can not use `writeln!` as any error // results in a "broken pipe" error. // // Instead we write directly to `stdout` and ignore any error // as we exit afterwards anyway. e . message . extend ( " \n " . chars ( ) ) ; if e . use_stderr ( ) { let _ = std :: io :: stderr ( ) . write_all ( e . message . as_bytes ( ) ) ; std :: process :: exit ( 1 ) ; } else { let _ = std :: io :: stdout ( ) . write_all ( e . message . as_bytes ( ) ) ; std :: process :: exit ( 0 ) ; } } , } ; < Self as StructOpt > :: from_clap ( & matches ) }
Helper function used to parse the command line arguments.
Helper function used to parse the command line arguments .
iter
I
iter
I