option.list revision 1.12
1/* $NetBSD: option.list,v 1.12 2025/09/10 23:58:21 kre Exp $ */
2
3/*
4 * define the shell's settable options
5 *
6 *	new options can be defined by adding them here,
7 *	but they do nothing until code to implement them
8 *	is added (using the "var name" field)
9 */
10
11/*
12 * format is up to 5 columns... (followed by anything)
13 * end of line comments can be introduced by ' #' (space/tab hash) to eol.
14 *
15 * The columns are:
16 *	1. internal shell "var name"	(required)
17 *	2. option long name
18 *		if a single char, then no long name, and remaining
19 *		columns shift left (this becomes the short name)
20 *	3. option short name (single character name)
21 *		if '-' or absent then no short name
22 *		if neither long nor short name, line is ignored
23 *	4. option set short name (name of option equiv class)
24 *		if '-' or absent then no class
25 *	5. default value of option
26 *		if absent, default is 0
27 *		only 0 or 1 possible (0==off 1==on) ("on" and "off" can be used)
28 *
29 * NB: Use only tabs to separate fields 1..3 (spaces can be used for 4 & 5)
30 *
31 * Data may be followed by any C preprocessor #if expression (incl the #if..)
32 * (including #ifdef #ifndef) to conditionalise output for that option.
33 * The #if expression continues until \n or next following '#'
34 */
35
36// the POSIX defined options
37aflag	allexport	a		# export all variables
38eflag	errexit		e		# exit on command error ($? != 0)
39mflag	monitor		m		# enable job control
40Cflag	noclobber	C		# do not overwrite files when using >
41nflag	noexec		n		# do not execue commands
42fflag	noglob		f		# no pathname expansion
43uflag	nounset		u		# expanding unset var is an error
44vflag	verbose		v		# echo commands as read
45xflag	xtrace		x		# trace command execution
46
47// the long name (ignoreeof) is standard, the I flag is not
48Iflag	ignoreeof	I		# do not exit interactive shell on EOF
49
50// defined but not really implemented by the shell (yet) - they do nothing
51bflag	notify		b		# [U] report bg job completion
52nolog	nolog				# [U] no func definitions in history
53// 'h' is standard, long name (trackall) is not
54hflag	trackall	h		# [U] locate cmds in funcs during defn
55
56// 's' is standard for command line, not as 'set' option, nor 'stdin' name
57sflag	stdin		s		# read from standard input
58// minusc		c		# command line option only.
59// --			r		# command line option only.
60// --			o		# handled differently...
61
62// non-standard options -- 'i' is just a state, not an option in standard.
63iflag	interactive	i		# interactive shell
64loginsh	login		l		# a login shell
65cdprint	cdprint				# always print result of a cd
66usefork	fork		F		# use fork(2) instead of vfork(2)
67pflag	nopriv		p		# preserve privs if set[ug]id
68posix	posix				# be closer to POSIX compat
69qflag	quietprofile	q		# disable -v/-x in startup files
70fnline1	local_lineno	L on		# number lines in funcs starting at 1
71promptcmds	promptcmds		# allow $( ) in PS1 (et al).
72pipefail	pipefail		# pipe exit status
73Xflag	xlock		X #ifndef SMALL	# sticky stderr for -x (implies -x)
74
75// editline/history related options ("vi" is standard, 'V' and others are not)
76// only one of vi/emacs can be set, hence the "set" definition, value
77// of that can be any char (not used for a different set)
78Vflag	vi		V V		# enable vi style editing
79Eflag	emacs		E V		# enable emacs style editing
80tabcomplete	tabcomplete		# make <tab> cause filename expansion
81
82// internal debug option (not usually included in the shell)
83debug	debug		#ifdef DEBUG	# enable internal shell debugging
84