mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 00:52:27 +02:00
Parse key=value named flag support. (#3515)
This commit is contained in:
committed by
GitHub
parent
bff81f24aa
commit
6fdfc84904
@ -525,6 +525,14 @@ impl Span {
|
||||
Span { start, end }
|
||||
}
|
||||
|
||||
pub fn new_option(start: usize, end: usize) -> Option<Span> {
|
||||
if end >= start {
|
||||
None
|
||||
} else {
|
||||
Some(Span { start, end })
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a `Span` with a length of 1 from the given position.
|
||||
///
|
||||
/// # Example
|
||||
|
Reference in New Issue
Block a user