nu-cli: directory syntax shape + completions (#5299)

This commit is contained in:
Herlon Aguiar
2022-04-22 22:18:51 +02:00
committed by GitHub
parent 661283c4d2
commit 5ff2ae628b
15 changed files with 211 additions and 9 deletions

View File

@ -530,6 +530,15 @@ pub fn eval_expression(
span: expr.span,
})
}
Expr::Directory(s) => {
let cwd = current_dir_str(engine_state, stack)?;
let path = expand_path_with(s, cwd);
Ok(Value::String {
val: path.to_string_lossy().to_string(),
span: expr.span,
})
}
Expr::GlobPattern(s) => {
let cwd = current_dir_str(engine_state, stack)?;
let path = expand_path_with(s, cwd);