summary refs log tree commit diff
path: root/bin/man1/setopt.1
blob: a148b28f2ec830fd20157891385911a2e9dc6809 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.Dd February 24, 2019
.Dt SETOPT 1
.Os
.
.Sh NAME
.Nm setopt
.Nd parse command options
.
.Sh SYNOPSIS
.Nm
.Ar optstring
.Op Ar args ...
.
.Sh DESCRIPTION
.Nm
behaves similarly to
.Xr getopt 1 ,
except that it produces quoted output
appropriate for use with the
.Nm eval
shell builtin.
This allows arguments containing whitespace
to survive parsing.
.
.Sh EXAMPLES
.Bd -literal -offset indent
args=$(setopt abo: "$@")
eval set -- "$args"
.Ed
.
.Sh SEE ALSO
.Xr getopt 1 ,
.Xr sh 1 ,
.Xr getopt 3
.
.Sh HISTORY
The
.Xr getopt 1
manual page of
.Fx
reads,
.Do
Arguments containing white space
or embedded shell metacharacters
generally will not survive intact;
this looks easy to fix but isn't.
.Dc
Yet here we are.
d6aa5b9d9297e51bd33a1&follow=1'>Replace __FBSDID macros with commentsJune McEnroe sed -E 's|__FBSDID[(]"([^"]+)"[)];|/* \1 */|' 2020-06-08Remove reference to FreeBSD-specific libedit hackJune McEnroe Newer versions of libedit have sane tab-complete now without FreeBSD's hacks, and in fact the hack is gone in FreeBSD-CURRENT. I'm still a little confused why binding this weird function is necessary at all, but at least it exists everywhere, I guess. 2020-06-08Prefix mandoc with exec in about-filterJune McEnroe 2020-06-07Remove mktemp options from mkbuiltins, mktokensJune McEnroe Why even? 2020-06-07Cast z_stream fields to size_tJune McEnroe In the version of zlib in OpenBSD, these fields are of type off_t, which is signed (why?), rather than uLong. 2020-06-07Call static_assert by _Static_assertJune McEnroe OpenBSD doesn't #define static_assert in assert.h and _Static_assert is its real name I guess so why not? 2020-06-07Add OpenBSD to install.shJune McEnroe Straightforward. 2020-06-03Add The Song of AchillesJune McEnroe 2020-06-01Allow redirecting input in everJune McEnroe 2020-05-31Add %c conversion to c scriptJune McEnroe 2020-05-31Add c script to READMEJune McEnroe 2020-05-31Add c scriptJune McEnroe 2020-05-31Update mdoc source URLsJune McEnroe 2020-05-26Remove unfinished PSF fontsJune McEnroe