pub struct ArgSpecBuilder { /* fields omitted */ }Expand description
Completes building the ArgSpec and returns it.
let spec = ArgSpec::build()
.unsigned_integer("chickens")
.done();
Little Wrapper function that will complete building the ArgSpec
and immediately call [parse()].
let args = ArgSpec::build()
.boolean("fullscreen")
.boolean("vsync")
.string("username")
.parse()?;
Adds a boolean argument to the ArgSpec.
let spec = ArgSpec::build().boolean("vsync").done();
assert_eq!(spec.has_arg("vsync", ArgType::Boolean), true);
Adds an i64 argument to the ArgSpec.
let spec = ArgSpec::build().integer("num-bananas").done();
assert_eq!(spec.has_arg("num-bananas", ArgType::Integer), true);
Adds a u64 argument to the ArgSpec.
let spec = ArgSpec::build().unsigned_integer("screen-width").done();
assert_eq!(spec.has_arg("screen-width", ArgType::UInteger), true);
Adds a String argument to the ArgSpec.
let spec = ArgSpec::build().string("MOD").done();
assert_eq!(spec.has_arg("MOD", ArgType::String), true);
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.