|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue wan't with getopts but with my usage of it (well, now that's
obvious that the problem wouldn't be in the implementation, but on how
I was using).
The problem was on:
1) my confusion on when and where to "shift";
2) make sure to look for the "--help" and "--version" long flags before
getopts, because it doesn't know about long flags.
Those fixed, the tests are now working again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, instead of looking at "${LANG:-}" for choosing the language, we
now use LC_MESSAGES from the locale(1) command. LC_MESSAGES is the
appropriate place to look at, and it inherits the value of $LANG by
default, but can be overriden so that the text messages from a program
spits out strings from a language, but use everything else from
$LANG (such as LC_NUMERIC), like in:
LANG=abc
LC_MESSAGES=zzz
I took this opportunity to look only at the language and country part
of the locale, and not at the codeset or modifier (as in
ll_CC.CODESET@modifier), so that as long as the language+country is the
same, it uses the according message.
This addresses the
"Maybe it could be less restrictive of country or encoding" comment on
|