forked from extern/nushell
Update path completions to handle spaces (#5419)
This commit is contained in:
@ -126,6 +126,17 @@ pub fn trim_quotes(bytes: &[u8]) -> &[u8] {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn trim_quotes_str(s: &str) -> &str {
|
||||
if (s.starts_with('"') && s.ends_with('"') && s.len() > 1)
|
||||
|| (s.starts_with('\'') && s.ends_with('\'') && s.len() > 1)
|
||||
|| (s.starts_with('`') && s.ends_with('`') && s.len() > 1)
|
||||
{
|
||||
&s[1..(s.len() - 1)]
|
||||
} else {
|
||||
s
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_call(command: Span, sig: &Signature, call: &Call) -> Option<ParseError> {
|
||||
// Allow the call to pass if they pass in the help flag
|
||||
if call.named_iter().any(|(n, _, _)| n.item == "help") {
|
||||
|
Reference in New Issue
Block a user