Struct probe_rs_cli_util::common_options::CargoOptions
source · 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: bool§target: Option<String>§manifest_path: Option<PathBuf>§no_default_features: bool§all_features: bool§features: 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§
source§impl CargoOptions
impl CargoOptions
sourcepub fn help_message(bin: &str) -> String
pub fn help_message(bin: &str) -> String
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::clap::{Parser, CommandFactory, FromArgMatches};
let help_message = CargoOptions::help_message("cargo flash");
let matches = FlashOptions::command()
.bin_name("cargo flash")
.after_help(&help_message)
.get_matches_from(std::env::args());
let opts = FlashOptions::from_arg_matches(&matches);sourcepub fn to_cargo_options(&self) -> Vec<String> ⓘ
pub fn to_cargo_options(&self) -> Vec<String> ⓘ
Generates list of arguments to cargo from a CargoOptions. For
example, if CargoOptions::release is set, resultant list will
contain a "--release".
Trait Implementations§
source§impl Args for CargoOptions
impl Args for CargoOptions
source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
source§impl CommandFactory for CargoOptions
impl CommandFactory for CargoOptions
source§impl Debug for CargoOptions
impl Debug for CargoOptions
source§impl Default for CargoOptions
impl Default for CargoOptions
source§fn default() -> CargoOptions
fn default() -> CargoOptions
Returns the “default value” for a type. Read more
source§impl FromArgMatches for CargoOptions
impl FromArgMatches for CargoOptions
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from
ArgMatches to self.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from
ArgMatches to self.source§impl Parser for CargoOptions
impl Parser for CargoOptions
source§fn try_parse() -> Result<Self, Error<RichFormatter>>
fn try_parse() -> Result<Self, Error<RichFormatter>>
Parse from
std::env::args_os(), return Err on error.source§fn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error<RichFormatter>>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error<RichFormatter>>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
source§fn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
source§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error<RichFormatter>>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error<RichFormatter>>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.