Struct nereon::Opt [−][src]
pub struct Opt { pub node: String, pub short: Option<String>, pub long: Option<String>, pub env: Option<String>, pub flags: u32, pub default: Option<String>, pub format: Option<String>, pub usage: Option<String>, }
Fields
node: String
Dot separated path of destination node for this option. eg. "root.leaf"
.
short: Option<String>
Short option as single character string "s"
matches -s
.
long: Option<String>
Long option "long"
matches --long
.
env: Option<String>
Environment variable to use if option not parsed from command line.
flags: u32
OptFlag
values as u32
. eg Multiple as u32 | NoArg as u32
.
default: Option<String>
Value to use if not parsed from command line or environment variable.
format: Option<String>
Format the option. This is a simple string format where the first {}
will be replaced by the parsed value.
usage: Option<String>
Description of option used to generate the usage message.
Methods
impl Opt
[src]
impl Opt
pub fn new(
node: &str,
short: Option<&str>,
long: Option<&str>,
env: Option<&str>,
flags: u32,
default: Option<&str>,
format: Option<&str>,
usage: Option<&str>
) -> Opt
[src]
pub fn new(
node: &str,
short: Option<&str>,
long: Option<&str>,
env: Option<&str>,
flags: u32,
default: Option<&str>,
format: Option<&str>,
usage: Option<&str>
) -> Opt
Creates a new Opt
instance for use with nereon_init
or nereon_json
Arguments
node
- Dot separated path of destination node for this option. eg."root.leaf"
.short
- Short option as single character string"s"
matches-s
.long
- Long option"long"
matches--long
.env
- Environment variable to use if option not parsed from command line.flags
-OptFlag
values asu32
. egMultiple as u32 | NoArg as u32
.default
- Value to use if not parsed from command line or environment variable.format
- Format the option. This is a simple string format where the first{}
will be replaced by the parsed value.usage
- Description of option used to generate the usage message.
Trait Implementations
impl Clone for Opt
[src]
impl Clone for Opt
fn clone(&self) -> Opt
[src]
fn clone(&self) -> Opt
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Opt
[src]
impl Debug for Opt
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Opt
[src]
impl Default for Opt