Use better quoting for commandline args (#5271)

This commit is contained in:
JT
2022-04-21 15:31:52 +12:00
committed by GitHub
parent ded9d1cedb
commit 96253c69fb
4 changed files with 16 additions and 3 deletions

View File

@ -22,7 +22,10 @@ pub fn evaluate_commands(
let (block, delta) = {
let mut working_set = StateWorkingSet::new(engine_state);
let (input, _) = if commands.item.starts_with('\'') || commands.item.starts_with('"') {
let (input, _) = if commands.item.starts_with('\'')
|| commands.item.starts_with('"')
|| commands.item.starts_with('`')
{
(
trim_quotes(commands.item.as_bytes()),
commands.span.start + 1,

View File

@ -512,6 +512,7 @@ fn trim_enclosing_quotes(input: &str) -> String {
match (chars.next(), chars.next_back()) {
(Some('"'), Some('"')) => chars.collect(),
(Some('\''), Some('\'')) => chars.collect(),
(Some('`'), Some('`')) => chars.collect(),
_ => input.to_string(),
}
}