mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:15:49 +02:00
Add support for compound shorthand flags (#1414)
* Break multicharacter shorthand flags into single character flags * Remove shorthand flag test
This commit is contained in:
@ -6,6 +6,7 @@ use derive_new::new;
|
||||
use getset::Getters;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use std::cmp::Ordering;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// Anchors represent a location that a value originated from. The value may have been loaded from a file, fetched from a website, or parsed from some text
|
||||
@ -664,6 +665,18 @@ impl Span {
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd<usize> for Span {
|
||||
fn partial_cmp(&self, other: &usize) -> Option<Ordering> {
|
||||
(self.end - self.start).partial_cmp(other)
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<usize> for Span {
|
||||
fn eq(&self, other: &usize) -> bool {
|
||||
(self.end - self.start) == *other
|
||||
}
|
||||
}
|
||||
|
||||
impl language_reporting::ReportingSpan for Span {
|
||||
fn with_start(&self, start: usize) -> Self {
|
||||
if self.end < start {
|
||||
|
Reference in New Issue
Block a user