athityakumar / colorls

A Ruby gem that beautifies the terminal's ls command, with color and font-awesome icons. :tada:
MIT License
4.9k stars 387 forks source link

colorls -h shows help #598

Closed heitorpolidoro closed 8 months ago

heitorpolidoro commented 1 year ago

Description

Thanks for opening this issue. Add a brief description of what this issue is, and how to recreate it. Do tag the relevant issue(s) and PR(s) below. If required, add some screenshot(s) to showcase the issue.

When I run colorls -h shows the help (same if I run colorls --help) instead the flag --human-readable

t-mangoe commented 8 months ago

I think this behavior seems to be a specification. If the argument is only -h, colorls shows the help. https://github.com/athityakumar/colorls/blob/24e402c153274dc5b9cde89ad6235ac5a4746129/lib/colorls/flags.rb#L314-L315

avdv commented 8 months ago

Yes, this works as designed. ls -h showing the help was done for backward-compatibility. The -h/--human-readable flag was added later for GNU ls compatibility and has no effect for colorls (file sizes are always shown human readable) -- this is stated in the help text.