5
submitted 11 months ago by AnonymousLemming@feddit.de to c/openbsd@lemmy.ml

I frequently find myself needing to rerun commands with the -h flag, and I was just wondering why it is not the default behavior of programs to show sizes in human-readable terms?

top 5 comments
sorted by: hot top controversial new old
[-] glad_cat 7 points 11 months ago* (last edited 11 months ago)

I guess because most of the time the data is consumed by another script. I don’t know how OpenBSD behaves, but I would be pretty angry if I had to put such flags (like "-not-human") everywhere in my code, docker scripts, and pipelines.

[-] Tubbles@lemmy.world 4 points 11 months ago

I have the totally opposite opinion, since script writing is where I have a proper text editor with templates and snippets and other helpful tools. Its interactive commands at the terminal that I want to behave as much "human" as possible so I don't have to type so much

[-] AnonymousLemming@feddit.de 1 points 11 months ago

Thanks for the explanation.

[-] RankWeis@sh.itjust.works 4 points 11 months ago* (last edited 11 months ago)

I think it’s two reasons - first is that human readable formats are less specific, so three files that are “3gb” in size look the same, so it may be hiding information that it knows about

The second is that commands are very often used as parts of larger scripts, where human readability may not matter as much, or may not be applicable until the very last command when the output is actually shown.

Between these, and the fact that most commands try not to predict what your use case is, I think that having a -h option is going to be the norm going forward as well rather than having it as the default

[-] AnonymousLemming@feddit.de 2 points 11 months ago

Makes sense for interoperability with other scripts. Thank you.

this post was submitted on 23 Sep 2023
5 points (100.0% liked)

OpenBSD Operating System

484 readers
3 users here now

useful resources:

Developer blogs:

Ressources:

founded 4 years ago
MODERATORS