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,18 +91,30 @@ 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
if ($output | length) == 0 {
"" | cat
} else {
$output
| grid -c -s " " | grid -c -s " "
| cat | 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
if ($output | length) == 0 {
"" | cat
} else {
$output
| grid -c -s " " | grid -c -s " "
| cat | cat
} }
}
def la [dir?: string] { def la [dir?: string] {
_ls -al (if $dir == null { "" } else { $dir }) _ls -al (if $dir == null { "" } else { $dir })