pub struct Conventions {
pub options_first: bool,
pub unknown_options_are_operands: bool,
pub double_dash_ends_options: bool,
pub verbatim: bool,
pub numeric_option: Option<&'static str>,
}Expand description
States how one command’s words are read as its options and operands.
The default reads options anywhere among the operands, rejects an option no argument is
spelled as, ends options at --, and answers --help and -h with help. POSIX utilities
differ per command, and a declaration states where one does.
Fields§
§options_first: boolOptions end at the first operand: echo hello -n has two operands.
unknown_options_are_operands: boolA word naming an option no argument is spelled as is an operand, as is a cluster with one
such letter: echo -x writes -x.
double_dash_ends_options: bool-- ends the options. Where it does not, it is an operand like any other word.
verbatim: boolEvery word is an operand, operands beyond the command’s own are ignored, and help is not
answered: true --help exits 0.
numeric_option: Option<&'static str>The long spelling of the option a word of a dash and digits gives its digits to: head -5
is head --lines 5.
Trait Implementations§
Source§impl Clone for Conventions
impl Clone for Conventions
impl Copy for Conventions
Source§impl Debug for Conventions
impl Debug for Conventions
Source§impl Default for Conventions
impl Default for Conventions
impl Eq for Conventions
Source§impl PartialEq for Conventions
impl PartialEq for Conventions
impl StructuralPartialEq for Conventions
Auto Trait Implementations§
impl Freeze for Conventions
impl RefUnwindSafe for Conventions
impl Send for Conventions
impl Sync for Conventions
impl Unpin for Conventions
impl UnsafeUnpin for Conventions
impl UnwindSafe for Conventions
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
Source§impl<This> CliDeclarationLawsExt<This> for This
impl<This> CliDeclarationLawsExt<This> for This
Source§fn law_cli_declaration<Operation, Sources, Mode, Commands>(
&self,
name: &'static str,
operation: Operation,
sources: Sources,
mode: Mode,
conventions: Conventions,
) -> Result<(), &'static str>where
This: CliOperationAlg<Operation, Sources, Mode, Commands = Commands> + CliCommandsObserved<Commands = Commands>,
Operation: OperationAlg,
Sources: CliSources<<Operation as OperationAlg>::Args>,
fn law_cli_declaration<Operation, Sources, Mode, Commands>(
&self,
name: &'static str,
operation: Operation,
sources: Sources,
mode: Mode,
conventions: Conventions,
) -> Result<(), &'static str>where
This: CliOperationAlg<Operation, Sources, Mode, Commands = Commands> + CliCommandsObserved<Commands = Commands>,
Operation: OperationAlg,
Sources: CliSources<<Operation as OperationAlg>::Args>,
Checks that operation declared under name with sources describes exactly that, with
one argument per operation argument, in order, and distinct spellings and positions.
Source§impl<This> CliOutcomeLawsExt<This> for This
impl<This> CliOutcomeLawsExt<This> for This
Source§impl<This> CliProgramExt<This> for This
impl<This> CliProgramExt<This> for This
Source§fn compile_cli<Program>(
&self,
program: Program,
) -> <Program as CliProgramAlg<This>>::Commandswhere
Program: CliProgramAlg<This>,
fn compile_cli<Program>(
&self,
program: Program,
) -> <Program as CliProgramAlg<This>>::Commandswhere
Program: CliProgramAlg<This>,
Compiles a named CLI program with this interpreter.
impl<Source> CliStatedFor<ContextArg> for Source
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<This> ShapeProgramExt<This> for This
impl<This> ShapeProgramExt<This> for This
Source§fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
Folds a declaration with this interpretation.