diff options
-rw-r--r-- | bin/ksh/ksh.1 | 7 | ||||
-rw-r--r-- | bin/ksh/misc.c | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/bin/ksh/ksh.1 b/bin/ksh/ksh.1 index f33ef5b7896..e33a4b5e7ad 100644 --- a/bin/ksh/ksh.1 +++ b/bin/ksh/ksh.1 @@ -1,8 +1,8 @@ -.\" $OpenBSD: ksh.1,v 1.175 2016/03/04 18:16:50 millert Exp $ +.\" $OpenBSD: ksh.1,v 1.176 2016/03/06 11:56:20 natano Exp $ .\" .\" Public Domain .\" -.Dd $Mdocdate: March 4 2016 $ +.Dd $Mdocdate: March 6 2016 $ .Dt KSH 1 .Os .Sh NAME @@ -3734,7 +3734,8 @@ options (with single letter names) can be found in the parameter .Ic set Fl o with no option name will list all the options and whether each is on or off; .Ic set +o -will print the long names of all options that are currently on. +will print the current shell options in the form of a command that +can be reinput to the shell to achieve the same options settings. .Pp Remaining arguments, if any, are positional parameters and are assigned, in order, to the positional parameters (i.e. $1, $2, etc.). diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c index 2f02fbd7127..00f5a644660 100644 --- a/bin/ksh/misc.c +++ b/bin/ksh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.53 2015/12/21 04:57:50 mmcc Exp $ */ +/* $OpenBSD: misc.c,v 1.54 2016/03/06 11:56:20 natano Exp $ */ /* * Miscellaneous functions @@ -240,8 +240,10 @@ printoptions(int verbose) /* short version ala ksh93 */ shprintf("set"); for (i = 0; i < NELEM(options); i++) - if (Flag(i) && options[i].name) - shprintf(" -o %s", options[i].name); + if (options[i].name) + shprintf(" %co %s", + Flag(i) ? '-' : '+', + options[i].name); shprintf("\n"); } } |