On Tue, Jun 22, 2021 at 02:19:32PM +0000, Klemens Nanni wrote:
> On Tue, Jun 22, 2021 at 01:47:13PM +0100, Jason McIntyre wrote:
> > after:
> >
> > $ /usr/obj/usr.bin/tset/tset -Z
> > tset: unknown option -- Z
> > usage: tset [-cIQqrsVw] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]
>
> OK kn
>
thanks. i noticed sth else though:
$ reset -Z
reset: unknown option -- Z
usage: tset [-cIQqrsVw] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]
can we change it so that when you run tset as reset, the usage name
matches? i thought it would do that already but see now it does not. it
uses a weird _nc_progname argument in usage, which i do not understand
at all.
could it be easily fixed?
thanks,
jmc
Index: tset.c
===================================================================
RCS file: /cvs/src/usr.bin/tset/tset.c,v
retrieving revision 1.41
diff -u -p -r1.41 tset.c
--- tset.c 28 Jun 2019 13:35:05 -0000 1.41
+++ tset.c 22 Jun 2021 14:56:35 -0000
@@ -1094,28 +1094,9 @@ obsolete(char **argv)
static void
usage(void)
{
- static const char *tbl[] =
- {
- ""
- ,"Options:"
- ," -c set control characters"
- ," -e ch erase character"
- ," -I no initialization strings"
- ," -i ch interrupt character"
- ," -k ch kill character"
- ," -m mapping map identifier to type"
- ," -Q do not output control key settings"
- ," -r display term on stderr"
- ," -s output TERM set command"
- ," -V print curses-version"
- ," -w set window-size"
- };
- unsigned n;
- (void) fprintf(stderr, "Usage: %s [-cIQqrsVw] [-] "
- "[-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\n",
+ (void) fprintf(stderr, "usage: %s [-cIQqrsVw] [-] "
+ "[-e ch] [-i ch] [-k ch] [-m mapping] [terminal]",
_nc_progname);
- for (n = 0; n < sizeof(tbl) / sizeof(tbl[0]); ++n)
- fprintf(stderr, "%s\n", tbl[n]);
exit_error();
/* NOTREACHED */