"John W. Saalwaechter" <[EMAIL PROTECTED]> writes:
| Thanks to everyone who replied with all the great feedback and input.
| Here's an update on what I've done with this feature.
|
| 1. I tried various options to find a solid way of getting number
| formatting details (e.g. the thousands separator, and the grouping data)
| from the locale data, but this seems to me to still be murky territory,
| in the sense that the locale data is often incomplete, and the code has
| to account for a lot of exceptions. So what I did for now is make the
| ls option accept an optional argument, allowing the user the explicitly
| specify the thousands separator. If not specified, it defaults to a
| comma. The code also currently groups by three digits only.
I like --thousands-sep, but prefer --thousands-separator; it's better
not to abbreviate here -- the user can always do that, e.g. `ls --th.'
However, please revert to using a simple option with no argument at all.
The only reason I can see to accept an argument is to accommodate
those with sub-standard systems, and I try hard not to let such systems
influence user interfaces.
You can use the code in textutils' sort.c to determine which character
to use. In the case where the sort.c code uses CHAR_MAX + 1, you should
default to using `,'.
Note that when using %' (when available, as Ulrich Drepper suggested)
ls shouldn't have to compute any extra locale info at all.
| 2. I changed the option to "--thousands-sep[=CHAR]" instead of
| "--kilo-separator" and "-K". Allowing short options (-K) to take
| optional arguments causes all sorts of confusion and inconsistency, so
| I just made it a long option only. Plus I think "--thousands-sep" has
| a better ring to it than "--kilo-separator".