Skip to content

Get-ChildItem compatibility and Unix-style size output#57

Merged
joonro merged 4 commits intojoonro:developfrom
kforeverisback:develop
Aug 3, 2024
Merged

Get-ChildItem compatibility and Unix-style size output#57
joonro merged 4 commits intojoonro:developfrom
kforeverisback:develop

Conversation

@kforeverisback
Copy link
Copy Markdown
Contributor

@kforeverisback kforeverisback commented Aug 3, 2024

Thank you for this Awesome module! I've very much enjoyed using this! Here is some of my improvements, hope you'll find them useful

This PR adds the following functionalities:

  • Output compatibility with Get-ChildItem (see the issue below)
    • Drop-in replacement for Get-ChildItem (same output in bytes except color added)
    • Fixes right alignment when outputting human-readable size
  • Unix ls -h style formatting
    • Adds -h and -HumanReadableSize flag
    • Unix style size string (e.g. M instead of MB, K instead of KB etc)
    • Use single point precision and remove trailing zeros after decimal point
  • Adds color to the size column (DarkGreen for KB, DarkYellow for MB and DarkRed for GB)

Before:

cmd: Get-ChildItemColor
image

After:

cmd: Get-ChildItemColor
image

cmd: Get-ChildItemColor -h or Get-ChildItemColor -HumanReadableSize
image

Issues Closed or Referenced

Issues Closed or Referenced

@joonro joonro merged commit 7c2ead6 into joonro:develop Aug 3, 2024
@joonro
Copy link
Copy Markdown
Owner

joonro commented Aug 3, 2024

Thank you very much for the contribution! Merged.

@joonro
Copy link
Copy Markdown
Owner

joonro commented Aug 3, 2024

@kforeverisback Does this resolve #48 as well?

@kforeverisback
Copy link
Copy Markdown
Contributor Author

Yes it does portion of it.
The original author had another issue with alignment and something which I didn't understand that well

@joonro
Copy link
Copy Markdown
Owner

joonro commented Aug 3, 2024

Gotcha thank you very much, I just released a new version that contains your changes. It does look much better!

@joonro joonro mentioned this pull request Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compatible with Get-ChildItem and add -h or -HumanReadable flag similar to ls -h in Unix

2 participants