zevv / duc

Dude, where are my bytes: Duc, a library and suite of tools for inspecting disk usage
GNU Lesser General Public License v3.0
598 stars 79 forks source link

File sizes with -b option difficult to read without thousands delimiter (comma, period) #307

Open AGI-chandler opened 1 year ago

AGI-chandler commented 1 year ago

It would help to add the thousands delimiter when using -b option.  I think the code could even automatically use a comma or period based on the system's locale settings... Thanks

zevv commented 1 year ago

I like the readability of thousands separators, but I'm not too fond of them because it makes parsing ducs output much harder from scripts or other tools.

@l8gravely Opinions on this?

l8gravely commented 1 year ago

"Ico" == Ico Doornekamp @.***> writes:

I like the readability of thousands separators, but I'm not too fond of them because it makes parsing ducs output much harder from scripts or other tools.

@l8gravely Opinions on this?

I think we could add a -H (human) or -c (commified) flag to 'duc info -b -H ...' to show the data in a human readable format. Hmm... maybe -B is the better option, where -b is bytes, but -B is bytes in human readable format?

Shouldn't be too hard to add into the code.

Haven't looked though.

zevv commented 1 year ago

Ah, -B is not bad; the change is trivial, I'll put it in.

AGI-chandler commented 1 year ago

cool, thanks guys... would this only be for info subcommand or would work for the rest as well?

zevv commented 1 year ago

Bah, I hate naming. How should we call the longopt, -b is for --bytes, so -B will be for what?