From c76a340f1c4f6b735d4f08d15cfab9704cbb6ac2 Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Tue, 4 May 2021 21:03:32 +0000 Subject: 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@ --- usr.bin/getopt/getopt.1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/getopt/getopt.1 b/usr.bin/getopt/getopt.1 index 74cd0b459fa..b4a2e4c34c3 100644 --- a/usr.bin/getopt/getopt.1 +++ b/usr.bin/getopt/getopt.1 @@ -1,9 +1,9 @@ -.\" $OpenBSD: getopt.1,v 1.19 2018/03/16 16:58:26 schwarze Exp $ +.\" $OpenBSD: getopt.1,v 1.20 2021/05/04 21:03:31 naddy Exp $ .\" .\" This material, written by Henry Spencer, was released by him .\" into the public domain and is thus not subject to any copyright. .\" -.Dd $Mdocdate: March 16 2018 $ +.Dd $Mdocdate: May 4 2021 $ .Dt GETOPT 1 .Os .Sh NAME @@ -14,6 +14,13 @@ .Ar optstring .Va $* .Sh DESCRIPTION +The +.Nm +utility cannot handle option arguments containing whitespace; +consider using the standard +.Ic getopts +shell built-in instead. +.Pp .Nm is used to break up options in command lines for easy parsing by shell procedures, and to check for legal options. -- cgit v1.2.3