pub enum UnknownTolerance {
Strict,
Short,
Long,
Both,
}Expand description
Whether unrecognized flag-shaped tokens are denied or silently accepted
as positional arguments. The default (Strict) makes the allowlist
authoritative — any unrecognized -X or --foo is denied.
Variants§
Strict
Deny every unrecognized flag-shaped token. The safe default.
Short
Accept unknown single-dash tokens (-X, -help, -mayDie) as
positional. Reject unknown double-dash. Use for tools like
pdftotext that have single-dash long flags.
Long
Accept unknown double-dash tokens (--foo, --foo=value) as
positional. Reject unknown single-dash. Dangerous: most modern
destructive flags are double-dash, so enabling this can silently
accept mutating options. Reserved for tools with genuinely
unbounded long-flag surfaces (AWS CLI service flags).
Both
Accept both single-dash and double-dash unknowns as positional.
Most permissive; combines the cost of Short and Long.
Implementations§
Source§impl UnknownTolerance
impl UnknownTolerance
pub const fn allows_short(self) -> bool
pub const fn allows_long(self) -> bool
Trait Implementations§
Source§impl Clone for UnknownTolerance
impl Clone for UnknownTolerance
Source§fn clone(&self) -> UnknownTolerance
fn clone(&self) -> UnknownTolerance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for UnknownTolerance
Source§impl Debug for UnknownTolerance
impl Debug for UnknownTolerance
Source§impl Default for UnknownTolerance
impl Default for UnknownTolerance
Source§fn default() -> UnknownTolerance
fn default() -> UnknownTolerance
impl Eq for UnknownTolerance
Source§impl PartialEq for UnknownTolerance
impl PartialEq for UnknownTolerance
Source§fn eq(&self, other: &UnknownTolerance) -> bool
fn eq(&self, other: &UnknownTolerance) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UnknownTolerance
Auto Trait Implementations§
impl Freeze for UnknownTolerance
impl RefUnwindSafe for UnknownTolerance
impl Send for UnknownTolerance
impl Sync for UnknownTolerance
impl Unpin for UnknownTolerance
impl UnsafeUnpin for UnknownTolerance
impl UnwindSafe for UnknownTolerance
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.