Fixing du colorization

1) du without -h is now supported.
2) du -h can output a 2-digit file size, eg " 25MB", and will have a space character for padding, and this is now accounted for.
This commit is contained in:
Vincent Milum Jr 2020-01-08 14:02:08 -08:00 committed by GitHub
parent 92aac170d0
commit 43092396e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -7,19 +7,31 @@ regexp=\s+[\.\/]+([\w\s\-\_\.]+)(\/.*)?$
colours=default,bold blue,blue
======
# Size 'K'
regexp=^\d*[.,]?\dKi?\s
regexp=^\d{1,3}\s
colours=green
======
regexp=^ ?\d*[.,]?\dKi?\s
colours=green
======
# Size 'M'
regexp=^\d*[.,]?\dMi?\s
regexp=^\d{4,6}\s
colours=yellow
======
regexp=^ ?\d*[.,]?\dMi?\s
colours=yellow
======
# Size 'G'
regexp=^\d*[.,]?\dGi?\s
regexp=^\d{7,9}\s
colours=red
======
regexp=^ ?\d*[.,]?\dGi?\s
colours=red
======
# Size 'T'
regexp=^\d*[.,]?\dTi?\s
regexp=^\d{10,12}\s
colours=bold red
======
regexp=^ ?\d*[.,]?\dTi?\s
colours=bold red
======
# Total