NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59956: gpt(8): show human-readable units



The following reply was made to PR bin/59956; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/59956: gpt(8): show human-readable units
Date: Wed, 04 Feb 2026 23:14:43 +0700

     Date:        Wed,  4 Feb 2026 15:10:02 +0000 (UTC)
     From:        "Rob Whitlock via gnats" <gnats-admin%NetBSD.org@localhost>
     Message-ID:  <20260204151002.0DB501A923E%mollari.NetBSD.org@localhost>
 
   |  The only thing I can think of is to perhaps keep it parseable by fields,
 
 Ah, no, not this:
 
   |  so
   |          1T 775G 270M  63G 771M 71K 512B      3  GPT part - NetBSD swap
 
 That's supposed to be (at least kind of) human readable, parsing something
 designed for humans when there's a more machine readable form available
 (with just the plain block numbers) would be just bizarre.   See the reply
 I will send to Martin's message soon after this for more on parseable versions.
 
   |  would be something like
   |  
   |          1T,775G,270M  63G,771M,71K,512B      3  GPT part - NetBSD swap
   |  
   |  or whatever the appropriate separator is for the current locale.
 
 There's nothing locale related in this (and for this I am not sure
 how there really could be).   I actually started with a '+' between the
 fields (actually, the first version, due to a bug, simply had them
 all run together, like
 
 	1T775G270M
 
 but that's definitely not human readable), the version with '+'
 looked ugly as well
 
 	1T+775G+270M
 
 I considered using '_' (but didn't try that one), when spaces seemed
 like a reasonable choice.  There is exactly one instance of the selected
 character in the source, so changing it (or making it conditional in
 some way) is trivial.
 
 But do aim for better human readability, along with retaining the accuracy
 (the -A which simply gives the humanize_number(3) result is an alternative
 when all you care about is getting an idea of the layout, and no secific
 details).
 
 Anything which anyone things will make it more readable, for people, not
 machines, I'm certainly willing to consider.
 
 kre
 
 
 


Home | Main Index | Thread Index | Old Index