2 * Copyright (c) 2013, 2014, 2015, 2017
3 * mirabilos <m@mirbsd.org>
5 * Provided that these terms and disclaimer and all copyright notices
6 * are retained or reproduced in an accompanying document, permission
7 * is granted to deal in this work without restriction, including un-
8 * limited rights to use, publicly perform, distribute, sell, modify,
9 * merge, give away, or sublicence.
11 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
12 * the utmost extent permitted by applicable law, neither express nor
13 * implied; without malicious intent or gross negligence. In no event
14 * may a licensor, author or contributor be held liable for indirect,
15 * direct, other damage, loss, or other issues arising in any way out
16 * of dealing in the work, even if advised of the possibility of such
17 * damage or existence of a defect, except proven that it results out
18 * of said person's immediate fault when using the work as intended.
22 __RCSID("$MirOS: src/bin/mksh/sh_flags.opt,v 1.6 2018/08/10 02:53:39 tg Exp $");
24 #define FN(sname,cname,flags,ochar) cname,
25 #define F0(sname,cname,flags,ochar) cname = 0,
27 #define FN(sname,cname,flags,ochar) ((const char *)(&shoptione_ ## cname)) + 2,
39 * options are sorted by their longnames
42 /* -a all new parameters are created with the export attribute */
44 F0("allexport", FEXPORT, OF_ANY
48 FN("bgnice", FBGNICE, OF_ANY
50 /* ./. enable {} globbing (non-standard) */
52 FN("braceexpand", FBRACEEXPAND, OF_ANY
54 /* ./. Emacs command line editing mode */
55 >|!MKSH_NO_CMDLINE_EDITING
56 FN("emacs", FEMACS, OF_ANY
58 /* -e quit on error */
60 FN("errexit", FERREXIT, OF_ANY
62 /* ./. Emacs command line editing mode, gmacs variant */
63 >|!MKSH_NO_CMDLINE_EDITING
64 FN("gmacs", FGMACS, OF_ANY
66 /* ./. reading EOF does not exit */
68 FN("ignoreeof", FIGNOREEOF, OF_ANY
70 /* ./. inherit -x flag */
72 FN("inherit-xtrace", FXTRACEREC, OF_ANY
74 /* -i interactive shell */
76 FN("interactive", FTALKING, OF_CMDLINE
78 /* -k name=value are recognised anywhere */
80 FN("keyword", FKEYWORD, OF_ANY
84 FN("login", FLOGIN, OF_CMDLINE
86 /* -X mark dirs with / in file name completion */
88 FN("markdirs", FMARKDIRS, OF_ANY
90 /* -m job control monitoring */
92 FN("monitor", FMONITOR, OF_ANY
94 /* -C don't overwrite existing files */
96 FN("noclobber", FNOCLOBBER, OF_ANY
98 /* -n don't execute any commands */
100 FN("noexec", FNOEXEC, OF_ANY
102 /* -f don't do file globbing */
104 FN("noglob", FNOGLOB, OF_ANY
106 /* ./. don't kill running jobs when login shell exits */
108 FN("nohup", FNOHUP, OF_ANY
110 /* ./. don't save functions in history (no effect) */
112 FN("nolog", FNOLOG, OF_ANY
114 /* -b asynchronous job completion notification */
116 FN("notify", FNOTIFY, OF_ANY
118 /* -u using an unset variable is an error */
120 FN("nounset", FNOUNSET, OF_ANY
122 /* ./. don't do logical cds/pwds (non-standard) */
124 FN("physical", FPHYSICAL, OF_ANY
126 /* ./. errorlevel of a pipeline is the rightmost nonzero value */
128 FN("pipefail", FPIPEFAIL, OF_ANY
130 /* ./. adhere more closely to POSIX even when undesirable */
132 FN("posix", FPOSIX, OF_ANY
134 /* -p privileged shell (suid) */
136 FN("privileged", FPRIVILEGED, OF_ANY
138 /* -r restricted shell */
140 FN("restricted", FRESTRICTED, OF_CMDLINE
142 /* ./. kludge mode for better compat with traditional sh (OS-specific) */
146 /* -s (invocation) parse stdin (pseudo non-standard) */
148 FN("stdin", FSTDIN, OF_CMDLINE
150 /* -h create tracked aliases for all commands */
152 FN("trackall", FTRACKALL, OF_ANY
154 /* -U enable UTF-8 processing (non-standard) */
156 FN("utf8-mode", FUNNYCODE, OF_ANY
160 FN("verbose", FVERBOSE, OF_ANY
162 /* ./. Vi command line editing mode */
163 >|!MKSH_NO_CMDLINE_EDITING
166 /* ./. enable ESC as file name completion character (non-standard) */
167 >|!MKSH_NO_CMDLINE_EDITING
168 FN("vi-esccomplete", FVIESCCOMPLETE, OF_ANY
170 /* ./. enable Tab as file name completion character (non-standard) */
171 >|!MKSH_NO_CMDLINE_EDITING
172 FN("vi-tabcomplete", FVITABCOMPLETE, OF_ANY
174 /* ./. always read in raw mode (no effect) */
175 >|!MKSH_NO_CMDLINE_EDITING
176 FN("viraw", FVIRAW, OF_ANY
178 /* -x execution trace (display commands as they are run) */
180 FN("xtrace", FXTRACE, OF_ANY
182 /* -c (invocation) execute specified command */
184 FN("", FCOMMAND, OF_CMDLINE
187 * anonymous flags: used internally by shell only (not visible to user
190 /* ./. direct builtin call (divined from argv[0] multi-call binary) */
192 FN("", FAS_BUILTIN, OF_INTERNAL
194 /* ./. (internal) initial shell was interactive */
196 FN("", FTALKING_I, OF_INTERNAL