xref: /netbsd/bin/sh/option.list (revision 4713e4ae)
1*4713e4aeSkre/* $NetBSD: option.list,v 1.10 2022/09/18 06:03:19 kre Exp $ */
2d12494dcSkre
3d12494dcSkre/*
4d12494dcSkre * define the shell's settable options
58bb39781Skre *
68bb39781Skre *	new options can be defined by adding them here,
78bb39781Skre *	but they do nothing until code to implement them
88bb39781Skre *	is added (using the "var name" field)
9d12494dcSkre */
10d12494dcSkre
11d12494dcSkre/*
12d12494dcSkre * format is up to 5 columns... (followed by anything)
13d12494dcSkre * end of line comments can be introduced by ' #' (space/tab hash) to eol.
14d12494dcSkre *
15d12494dcSkre * The columns are:
16d12494dcSkre *	1. internal shell "var name"	(required)
17d12494dcSkre *	2. option long name
18d12494dcSkre *		if a single char, then no long name, and remaining
19d12494dcSkre *		columns shift left (this becomes the short name)
20d12494dcSkre *	3. option short name (single character name)
21d12494dcSkre *		if '-' or absent then no short name
22d12494dcSkre *		if neither long nor short name, line is ignored
23d12494dcSkre *	4. option set short name (name of option equiv class)
24d12494dcSkre *		if '-' or absent then no class
258bb39781Skre *	5. default value of option
26d12494dcSkre *		if absent, default is 0
278bb39781Skre *		only 0 or 1 possible (0==off 1==on) ("on" and "off" can be used)
288bb39781Skre *
298bb39781Skre * Data may be followed by any C preprocessor #if expression (incl the #if..)
308bb39781Skre * (including #ifdef #ifndef) to conditionalise output for that option.
318bb39781Skre * The #if expression continues until \n or next following '#'
32d12494dcSkre */
33d12494dcSkre
348bb39781Skre// the POSIX defined options
35d12494dcSkreaflag	allexport	a		# export all variables
36d12494dcSkreeflag	errexit		e		# exit on command error ($? != 0)
37d12494dcSkremflag	monitor		m		# enable job control
38d12494dcSkreCflag	noclobber	C		# do not overwrite files when using >
39d12494dcSkrenflag	noexec		n		# do not execue commands
40d12494dcSkrefflag	noglob		f		# no pathname expansion
41d12494dcSkreuflag	nounset		u		# expanding unset var is an error
42d12494dcSkrevflag	verbose		v		# echo commands as read
43d12494dcSkrexflag	xtrace		x		# trace command execution
44d12494dcSkre
458bb39781Skre// the long name (ignoreeof) is standard, the I flag is not
468bb39781SkreIflag	ignoreeof	I		# do not exit interactive shell on EOF
478bb39781Skre
488bb39781Skre// defined but not really implemented by the shell (yet) - they do nothing
498bb39781Skrebflag	notify		b		# [U] report bg job completion
508bb39781Skrenolog	nolog				# [U] no func definitions in history
518bb39781Skre// 'h' is standard, long name (trackall) is not
528bb39781Skrehflag	trackall	h		# [U] locate cmds in funcs during defn
538bb39781Skre
548bb39781Skre// 's' is standard for command line, not as 'set' option, nor 'stdin' name
558bb39781Skresflag	stdin		s		# read from standard input
568bb39781Skre// minusc		c		# command line option only.
578bb39781Skre// --			o		# handled differently...
588bb39781Skre
598bb39781Skre// non-standard options -- 'i' is just a state, not an option in standard.
608bb39781Skreiflag	interactive	i		# interactive shell
61*4713e4aeSkreloginsh	login		l		# a login shell
628bb39781Skrecdprint	cdprint				# always print result of a cd
638bb39781Skreusefork	fork		F		# use fork(2) instead of vfork(2)
648bb39781Skrepflag	nopriv		p		# preserve privs if set[ug]id
658bb39781Skreposix	posix				# be closer to POSIX compat
668bb39781Skreqflag	quietprofile	q		# disable -v/-x in startup files
6765a863e5Skrefnline1	local_lineno	L on		# number lines in funcs starting at 1
6802574faeSkrepromptcmds promptcmds			# allow $( ) in PS1 (et al).
69bcb74acdSkrepipefail pipefail			# pipe exit status
7016704df8SkreXflag	xlock		X #ifndef SMALL	# sticky stderr for -x (implies -x)
718bb39781Skre
728bb39781Skre// editline/history related options ("vi" is standard, 'V' and others are not)
738bb39781Skre// only one of vi/emacs can be set, hence the "set" definition, value
748bb39781Skre// of that can be any char (not used for a different set)
758bb39781SkreVflag	vi		V V		# enable vi style editing
768bb39781SkreEflag	emacs		E V		# enable emacs style editing
778bb39781Skretabcomplete	tabcomplete		# make <tab> cause filename expansion
788bb39781Skre
798bb39781Skre// internal debug option (not usually included in the shell)
808bb39781Skredebug	debug		#ifdef DEBUG	# enable internal shell debugging
81