pub struct Args {
pub manifest_path: Option<PathBuf>,
pub packages: Vec<String>,
pub header_file: Option<PathBuf>,
pub format: OutputFormat,
pub offence_threshold: usize,
pub rules: Vec<String>,
pub skipped_rules: Vec<String>,
}Fields§
§manifest_path: Option<PathBuf>§packages: Vec<String>§header_file: Option<PathBuf>File holding the header every .rs file must open with. It is data rather than a built-in constant because it is never the same twice: MIT here, Apache 2.0 in a sibling repository, and a different year again next year.
format: OutputFormatHow to report. The table is for a person; json is the same run as a
document, for a gate script or an agent that would otherwise have to
guess where one column of the table ends and the next begins.
offence_threshold: usizeHow many offences the report prints. A first run against a large codebase can find a thousand, and a thousand rows is a wall rather than a report. The cap is on what is shown and never on what is counted: the summary, the omitted count and the exit code all see every offence. Use 0 for no limit.
rules: Vec<String>Apply only these rules; repeatable. Omit to apply every rule. Naming one makes the selection a whitelist, which is what lets a codebase facing hundreds of offences gate on one rule today and the rest as it goes.
skipped_rules: Vec<String>Do not apply these rules; repeatable. Subtracted from whatever –rule selected, so skipping wins over selecting.
Implementations§
Source§impl Args
impl Args
pub fn parse_args() -> Self
Sourcepub fn without_cargo_subcommand<I>(args: I) -> Vec<String>where
I: IntoIterator<Item = String>,
pub fn without_cargo_subcommand<I>(args: I) -> Vec<String>where
I: IntoIterator<Item = String>,
Cargo invokes cargo stern4rust as cargo-stern4rust stern4rust ..., so
the subcommand name arrives as an extra leading argument that clap would
otherwise reject. Running the binary directly does not repeat it, which
is why the strip is conditional rather than unconditional.
Trait Implementations§
Source§impl Args for Args
impl Args for Args
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Args
impl CommandFactory for Args
Source§impl FromArgMatches for Args
impl FromArgMatches for Args
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>
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>
ArgMatches to self.