Better definition for ls

This commit is contained in:
Thomas Forgione 2023-11-10 09:31:11 +01:00
parent 53fe43ac0f
commit fea82c6f85
1 changed files with 18 additions and 6 deletions

View File

@ -91,17 +91,29 @@ def _ls_format_mode [mode: string] {
} }
def l [dir?: string] { def l [dir?: string] {
_ls (if $dir == null { "" } else { $dir }) let output = _ls (if $dir == null { "" } else { $dir })
| sort-by type name -i | sort-by type name -i
| grid -c -s " "
| cat if ($output | length) == 0 {
"" | cat
} else {
$output
| grid -c -s " "
| cat
}
} }
def ls [dir?: string] { def ls [dir?: string] {
_ls (if $dir == null { "" } else { $dir }) let output = _ls (if $dir == null { "" } else { $dir })
| sort-by type name -i | sort-by type name -i
| grid -c -s " "
| cat if ($output | length) == 0 {
"" | cat
} else {
$output
| grid -c -s " "
| cat
}
} }
def la [dir?: string] { def la [dir?: string] {