History log of /netbsd-src/bin/sh/mkoptions.sh (Results 1 – 9 of 9)
Revision Date Author Comments
# d434d049 11-Oct-2024 kre <kre@NetBSD.org>

Allow '+' to be specified as the "one char option name" for long options
that don't have a 1 char equivalent, but do want to become a member of
an option set. The '+' is otherwise ignored. This is

Allow '+' to be specified as the "one char option name" for long options
that don't have a 1 char equivalent, but do want to become a member of
an option set. The '+' is otherwise ignored. This is similar to '-'
in that position, except that skips past the option set field, and is
followed directly by the default value, '+' does not do that.

This currently changes nothing, as there are no current options that
use it (or would want to).

show more ...


# eda85bc1 16-Apr-2024 christos <christos@NetBSD.org>

Be more explicit with sort fields to produce consistent results with gnu
sort (Jan-Benedict Glaw)


# 1568b401 06-Apr-2024 kre <kre@NetBSD.org>

Redo the mktemp(1) part - some mktemp's (including ours) require the
XXXX's to be at the end of the name (like mk*temp(3)) so however well
it will work with mktemp implementations which allow the X's

Redo the mktemp(1) part - some mktemp's (including ours) require the
XXXX's to be at the end of the name (like mk*temp(3)) so however well
it will work with mktemp implementations which allow the X's to be
anywhere in the final component of the name, it will work just as
well on them with the X's at the end.

But we don't normally need all of that mess - knowing which temp
file is which is useful only when debugging the script, and that's
(mostly) long done. So, in normal uses now just use $(mktemp) and
allow mktemp to pick its own name - we don't need to know what it is.
Every mktemp(1) supports that mode of operation.

Bug when debugging the script (which for current purposes will be
taken to be when the -x flag is passed to the shell running it, to
trace what it does) then we will make the temp files have names we
can recognise (and in that case, also don't delete them when done).

While here, check for mktemp(1) failing, and abort if that
happens (we assume that if it fails it will write an error
message to stderr, so the script does not need to.)

As for the purpose of the script ... of course the header file
generated (or an equivalent elsewhere) could be generated and
maintained by hand, but why would anyone want to do all that
work when software can do it for us, and do it correctly without
human thought?

This also allows the options in the master list (option.list) to be
arranged in a way that is meaningful for them, unrelated to the order
the shell needs to have them in (or rearrange them to be at run time)
and have that order shuffled however is convenient. Currently all
the posix standard options are first, then the "hybrid" options, and
finally the local ones for this shell. Currently "pipefail" is in the
final set, but once the next posix version is published, that will
become a standard option, and get moved in the list - the shell won't
even notice as this script puts the options into shell desired order.

show more ...


# 3200c281 05-Apr-2024 christos <christos@NetBSD.org>

From Jan-Benedict Glaw:

Fix a redirection and prepare a stable sort for upper-/lowercase
option letters

This script is a mess, I strongly believe that it should be rewritten.
However, I'm not 100%

From Jan-Benedict Glaw:

Fix a redirection and prepare a stable sort for upper-/lowercase
option letters

This script is a mess, I strongly believe that it should be rewritten.
However, I'm not 100% sure why it was invented in the first place
(come on, the generated header file isn't _that_ complicated that
it couldn't be sanely managed by hand!), but let's fix the sorting
order by using LC_ALL=C.

Also add a few 'X' to the `mktemp` template to make non-BSD
implementations happy. As a bonus, actually *use* the initial `sed`
output instead of throwing it away by piping it into `sort` with
also connecting `sort`'s stdin with the original input file...

show more ...


# 20c8eb69 15-Nov-2017 kre <kre@NetBSD.org>

Sort options with long names that differ only by char case in
the same order that option flags with a similar property are sorted.
This corresponds with the change made to the sort order of the short

Sort options with long names that differ only by char case in
the same order that option flags with a similar property are sorted.
This corresponds with the change made to the sort order of the short
names made in the previous update (1.4).

Right now, this change makes no difference at all, as there are no
long option names that differ only in char case (yet.)

show more ...


# 2ff69d1b 01-Jul-2017 kre <kre@NetBSD.org>

Make $- list flags in the same order they appear in sh(1)


# bbd0083b 19-Jun-2017 kre <kre@NetBSD.org>

"b" more forgiving when sorting options to allow reasonable (and intended)
flexibility in option.list format. Changes nothing for current option.list.


# d6a4153f 28-May-2017 kre <kre@NetBSD.org>

Redo mkoptions.sh .. much better this way, now fully automated
option sorting (no longer required option.list to be manually
sorted by long option name) and properly handles conditional
options. Cl

Redo mkoptions.sh .. much better this way, now fully automated
option sorting (no longer required option.list to be manually
sorted by long option name) and properly handles conditional
options. Cleaner output format as well.

This allows option.list to be reordered to group related options
together ... also added more comments to it.

show more ...


# f359a311 28-May-2017 kre <kre@NetBSD.org>

Arrange for set -o and $- output to be sorted, rather than more
or less random (and becoming worse as more options are added.)
Since the data is known at compile time, sort at compile time,
rather th

Arrange for set -o and $- output to be sorted, rather than more
or less random (and becoming worse as more options are added.)
Since the data is known at compile time, sort at compile time,
rather than at run time.

show more ...