From 6156762f185f79cd885c6fa90d6af9ab20acb891 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sun, 21 Aug 2011 14:52:20 -0700 Subject: [PATCH] sh: Add do-nothing -h option. POSIX requires a -h option to sh and set, to locate and remember utilities invoked by functions as they are defined. Given that this locate-and-remember process is optional elsewhere, it seems safe enough to make this option do nothing. POSIX does not specify a long name for this option. Follow ksh in calling it "trackall". Obtained-from: FreeBSD 223281 --- bin/sh/options.h | 8 +++++--- bin/sh/sh.1 | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/sh/options.h b/bin/sh/options.h index a0d139e..ffa63a1 100644 --- a/bin/sh/options.h +++ b/bin/sh/options.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)options.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD: src/bin/sh/options.h,v 1.16 2011/06/13 21:03:27 jilles Exp $ + * $FreeBSD: src/bin/sh/options.h,v 1.17 2011/06/18 23:43:28 jilles Exp $ */ struct shparam { @@ -66,9 +66,10 @@ struct shparam { #define privileged optlist[15].val #define Tflag optlist[16].val #define Pflag optlist[17].val -#define tabcomplete optlist[18].val +#define hflag optlist[18].val +#define tabcomplete optlist[19].val -#define NOPTS 19 +#define NOPTS 20 struct optent { const char *name; @@ -96,6 +97,7 @@ struct optent optlist[NOPTS] = { { "privileged", 'p', 0 }, { "trapsasync", 'T', 0 }, { "physical", 'P', 0 }, + { "trackall", 'h', 0 }, { "tabcomplete", '\0', 0 }, }; #else diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index cdb0e7a..5740113 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -34,7 +34,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 -.\" $FreeBSD: src/bin/sh/sh.1,v 1.170 2011/06/17 13:03:49 jilles Exp $ +.\" $FreeBSD: src/bin/sh/sh.1,v 1.171 2011/06/18 23:43:28 jilles Exp $ .\" .Dd August 21, 2011 .Dt SH 1 @@ -245,6 +245,10 @@ tested, all commands of the function are considered to be tested as well. .It Fl f Li noglob Disable pathname expansion. +.It Fl h Li trackall +A do-nothing option for +.Tn POSIX +compliance. .It Fl I Li ignoreeof Ignore .Dv EOF Ap s -- 1.7.7.2