Struct probe_rs_cli_util::common_options::CargoOptions [−][src]
pub struct CargoOptions {
pub bin: Option<String>,
pub example: Option<String>,
pub package: Option<String>,
pub release: bool,
pub target: Option<String>,
pub manifest_path: Option<PathBuf>,
pub no_default_features: bool,
pub all_features: bool,
pub features: Vec<String>,
pub trailing_opts: Vec<String>,
}Expand description
Common options used when building artifacts with cargo.
Fields
bin: Option<String>example: Option<String>package: Option<String>release: booltarget: Option<String>manifest_path: Option<PathBuf>no_default_features: boolall_features: boolfeatures: Vec<String>trailing_opts: Vec<String>Escape hatch: all args passed after a sentinel -- end up here,
unprocessed. Used to pass arguments to cargo not declared in
CargoOptions.
Implementations
Generates a suitable help string to append to your program’s –help. Example usage:
use probe_rs_cli_util::common_options::{FlashOptions, CargoOptions};
use probe_rs_cli_util::structopt::StructOpt;
let matches = FlashOptions::clap()
.bin_name("cargo flash")
.after_help(CargoOptions::help_message("cargo flash").as_str())
.get_matches_from(std::env::args());
let opts = FlashOptions::from_clap(&matches);Trait Implementations
Returns the “default value” for a type. Read more
Builds the struct from clap::ArgMatches. It’s guaranteed to succeed
if matches originates from an App generated by StructOpt::clap called on
the same type, otherwise it must panic. Read more
Builds the struct from the command line arguments (std::env::args_os).
Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more
Builds the struct from the command line arguments (std::env::args_os).
Unlike StructOpt::from_args, returns clap::Error on failure instead of aborting the program,
so calling .exit is up to you. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
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. Read more
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec of your making. Read more