-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds manual page tweak from May 4: --- CVSROOT: /cvs Module name: src Changes by: [email protected] 2021/05/04 15:03:31 Modified files: bin/ksh : ksh.1 sh.1 usr.bin/getopt : getopt.1 Log message: shell scripts should use getopts instead of getopt Add a prominent deprecation notice to getopt.1. Add examples of the getopts idiom to sh.1 and ksh.1. Requested by and ok espie@, ok jmc@ -- Also adds today's commit: --- CVSROOT: /cvs Module name: src Changes by: [email protected] 2021/06/27 09:53:33 Modified files: bin/ksh : emacs.c Log message: In addition to 2-byte and 3-byte UTF-8 sequences, correctly identify all 4-byte UTF-8 sequences and not just some of them, to keep them together and avoid passing them on byte by byte, helping tools like tmux(1). While here, also do all the range tests with < and > rather than & for uniformity and readability, and add some comments. Input and OK jca@ and nicm@. Soeren at Soeren dash Tempel dot net originally reported the bug and provided an incomplete patch that was used as a starting point, and he also tested this final patch. ---
- Loading branch information
Showing
5 changed files
with
107 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.\" $OpenBSD: sh.1,v 1.152 2019/05/22 15:23:23 schwarze Exp $ | ||
.\" $OpenBSD: sh.1,v 1.153 2021/05/04 21:03:31 naddy Exp $ | ||
.\" | ||
.\" Copyright (c) 2015 Jason McIntyre <[email protected]> | ||
.\" | ||
|
@@ -14,7 +14,7 @@ | |
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
.\" | ||
.Dd $Mdocdate: May 22 2019 $ | ||
.Dd $Mdocdate: May 4 2021 $ | ||
.Dt SH 1 | ||
.Os | ||
.Sh NAME | ||
|
@@ -508,6 +508,25 @@ is a colon, | |
.Ev OPTARG | ||
is set to the unsupported option, | ||
otherwise an error message is displayed. | ||
.Pp | ||
The following code fragment shows how one might process the arguments | ||
for a command that can take the option | ||
.Fl a | ||
and the option | ||
.Fl o , | ||
which requires an argument. | ||
.Bd -literal -offset indent | ||
while getopts ao: name | ||
do | ||
case $name in | ||
a) flag=1 ;; | ||
o) oarg=$OPTARG ;; | ||
?) echo "Usage: ..."; exit 2 ;; | ||
esac | ||
done | ||
shift $(($OPTIND - 1)) | ||
echo "Non-option arguments: " "$@" | ||
.Ed | ||
.It Ic hash Op Fl r | Ar utility | ||
Add | ||
.Ar utility | ||
|