pub enum Format {
Json,
Text,
}Expand description
JSON or text, from --json/--text (see super::format_args).
Variants§
Implementations§
Source§impl Format
impl Format
Sourcepub fn of(matches: &ArgMatches, argv: &[OsString]) -> Format
pub fn of(matches: &ArgMatches, argv: &[OsString]) -> Format
The format asked for: JSON unless --text was given, and when both
switches were, the one given LAST on the command line — whichever
level (the tool’s or a subcommand’s) it belongs to.
The order is read from argv, because the parse cannot give it:
with the switches global, clap copies each level’s switch into the
other, so after fs.<fs> --text img ls --json BOTH read as given
at BOTH levels, at the same index. Taking “the deepest level’s” as
the answer, as this did before, answered text there. The parse still
decides WHETHER a switch was given, so an argument that merely looks
like one (after --) changes nothing.
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more