This commit is contained in:
Thomas Forgione 2024-03-12 13:50:09 +01:00
parent 227877d5ec
commit 258fbfc275
1 changed files with 6 additions and 6 deletions

View File

@ -33,22 +33,22 @@ def _ls_format_mode [mode: string] {
} }
# quick and easy ls # quick and easy ls
def ls [dir?: string] { def ls [dir?] {
let output = (if $dir == null { _ls } else { _ls (glob $dir) }) | sort-by type name -i let output = (if $dir == null { _ls } else { _ls $dir }) | sort-by type name -i
if ($output | length) == 0 { "" | cat } else { $output | grid -c -s " " | cat } if ($output | length) == 0 { "" | cat } else { $output | grid -c -s " " | cat }
} }
# ls with hidden files # ls with hidden files
def la [dir?: string] { def la [dir?] {
(if $dir == null { _ls -al } else { _ls -al (glob $dir) }) (if $dir == null { _ls -al } else { _ls -al $dir })
| sort-by type name -i | sort-by type name -i
| each { $in | update mode (_ls_format_mode $in.mode) } | each { $in | update mode (_ls_format_mode $in.mode) }
| select mode name target user size modified | select mode name target user size modified
} }
# ls with details # ls with details
def ll [dir?: string] { def ll [dir?] {
(if $dir == null { _ls -l } else { _ls -l (glob $dir) }) (if $dir == null { _ls -l } else { _ls -l })
| each { $in | update mode (_ls_format_mode $in.mode) } | each { $in | update mode (_ls_format_mode $in.mode) }
| sort-by type name -i | sort-by type name -i
| select mode name target user size modified | select mode name target user size modified