pub struct Opt {
pub test: bool,
pub list: bool,
pub verbose: bool,
pub report: bool,
pub reverse: bool,
pub exit_on_error: bool,
pub umask: String,
pub lsbsysinit: bool,
pub regex: Option<Regex>,
pub arg: Vec<String>,
pub dir: PathBuf,
}
Expand description
run scripts or programs in a directory
Fields§
§test: bool
print the names of the scripts which would be run, but don’t actually run them.
list: bool
print the names of the all matching files (not limited to executables), but don’t actually run them. This option cannot be used with –test.
verbose: bool
print the name of each script to stderr before running.
report: bool
similar to –verbose, but only prints the name of scripts which produce output. The script’s name is printed to whichever of stdout or stderr the script produces output on. The script’s name is not printed to stderr if –verbose also specified.
reverse: bool
reverse the scripts’ execution order.
exit_on_error: bool
exit as soon as a script returns with a non-zero exit code.
umask: String
sets the umask to umask before running the scripts. umask should be specified in octal. By default the umask is set to 022.
lsbsysinit: bool
filename must be in one or more of either the LANANA-assigned namespace, the LSB namespaces - either hierarchical or reserved - or the Debian cron script namespace.
regex: Option<Regex>
validate filenames against custom extended regular expression REGEX.
arg: Vec<String>
pass argument to the scripts. Use –arg once for each argument you want passed.
dir: PathBuf
Implementations§
Source§impl Opt
impl Opt
pub fn usage_error(&self, s: &str)
pub fn debug_options(&self)
Trait Implementations§
Source§impl StructOpt for Opt
impl StructOpt for Opt
Source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
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.Source§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.Source§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
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.Source§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Vec
of your making.
Print the error message and quit the program in case of failure. Read more