option.list revision 1.9
11.9Skre/* $NetBSD: option.list,v 1.9 2018/11/23 20:40:06 kre Exp $ */
21.1Skre
31.1Skre/*
41.1Skre * define the shell's settable options
51.2Skre *
61.2Skre *	new options can be defined by adding them here,
71.5Skre *	but they do nothing until code to implement them
81.2Skre *	is added (using the "var name" field)
91.1Skre */
101.1Skre
111.1Skre/*
121.1Skre * format is up to 5 columns... (followed by anything)
131.1Skre * end of line comments can be introduced by ' #' (space/tab hash) to eol.
141.1Skre *
151.1Skre * The columns are:
161.1Skre *	1. internal shell "var name"	(required)
171.1Skre *	2. option long name
181.1Skre *		if a single char, then no long name, and remaining
191.1Skre *		columns shift left (this becomes the short name)
201.1Skre *	3. option short name (single character name)
211.1Skre *		if '-' or absent then no short name
221.1Skre *		if neither long nor short name, line is ignored
231.1Skre *	4. option set short name (name of option equiv class)
241.1Skre *		if '-' or absent then no class
251.2Skre *	5. default value of option
261.1Skre *		if absent, default is 0
271.2Skre *		only 0 or 1 possible (0==off 1==on) ("on" and "off" can be used)
281.2Skre *
291.2Skre * Data may be followed by any C preprocessor #if expression (incl the #if..)
301.2Skre * (including #ifdef #ifndef) to conditionalise output for that option.
311.2Skre * The #if expression continues until \n or next following '#'
321.1Skre */
331.1Skre
341.2Skre// the POSIX defined options
351.1Skreaflag	allexport	a		# export all variables
361.1Skreeflag	errexit		e		# exit on command error ($? != 0)
371.1Skremflag	monitor		m		# enable job control
381.1SkreCflag	noclobber	C		# do not overwrite files when using >
391.1Skrenflag	noexec		n		# do not execue commands
401.1Skrefflag	noglob		f		# no pathname expansion
411.2Skreuflag	nounset		u		# expanding unset var is an error
421.2Skrevflag	verbose		v		# echo commands as read
431.2Skrexflag	xtrace		x		# trace command execution
441.2Skre
451.2Skre// the long name (ignoreeof) is standard, the I flag is not
461.2SkreIflag	ignoreeof	I		# do not exit interactive shell on EOF
471.2Skre
481.2Skre// defined but not really implemented by the shell (yet) - they do nothing
491.2Skrebflag	notify		b		# [U] report bg job completion
501.1Skrenolog	nolog				# [U] no func definitions in history
511.2Skre// 'h' is standard, long name (trackall) is not
521.2Skrehflag	trackall	h		# [U] locate cmds in funcs during defn
531.2Skre
541.2Skre// 's' is standard for command line, not as 'set' option, nor 'stdin' name
551.2Skresflag	stdin		s		# read from standard input
561.2Skre// minusc		c		# command line option only.
571.2Skre// --			o		# handled differently...
581.2Skre
591.2Skre// non-standard options -- 'i' is just a state, not an option in standard.
601.2Skreiflag	interactive	i		# interactive shell
611.2Skrecdprint	cdprint				# always print result of a cd
621.2Skreusefork	fork		F		# use fork(2) instead of vfork(2)
631.1Skrepflag	nopriv		p		# preserve privs if set[ug]id
641.1Skreposix	posix				# be closer to POSIX compat
651.1Skreqflag	quietprofile	q		# disable -v/-x in startup files
661.4Skrefnline1	local_lineno	L on		# number lines in funcs starting at 1
671.5Skrepromptcmds promptcmds			# allow $( ) in PS1 (et al).
681.6Skrepipefail pipefail			# pipe exit status
691.9SkreXflag	xlock		X #ifndef SMALL	# sticky stderr for -x (implies -x)
701.2Skre
711.2Skre// editline/history related options ("vi" is standard, 'V' and others are not)
721.2Skre// only one of vi/emacs can be set, hence the "set" definition, value
731.2Skre// of that can be any char (not used for a different set)
741.2SkreVflag	vi		V V		# enable vi style editing
751.2SkreEflag	emacs		E V		# enable emacs style editing
761.1Skretabcomplete	tabcomplete		# make <tab> cause filename expansion
771.1Skre
781.2Skre// internal debug option (not usually included in the shell)
791.2Skredebug	debug		#ifdef DEBUG	# enable internal shell debugging
80