make ls works better with glob (#5691)

* fix glob behavior

* fix doc
This commit is contained in:
WindSoilder
2022-05-31 08:13:27 +08:00
committed by GitHub
parent f5519e2a09
commit 0769e9b750
9 changed files with 79 additions and 4 deletions

View File

@ -417,7 +417,9 @@ impl ExternalCommand {
let cwd = PathBuf::from(cwd);
if arg.item.contains('*') {
if let Ok((prefix, matches)) = nu_engine::glob_from(&arg, &cwd, self.name.span) {
if let Ok((prefix, matches)) =
nu_engine::glob_from(&arg, &cwd, self.name.span, None)
{
let matches: Vec<_> = matches.collect();
// FIXME: do we want to special-case this further? We might accidentally expand when they don't