11.12Skre/* $NetBSD: option.list,v 1.12 2025/09/10 23:58:21 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.12Skre * NB: Use only tabs to separate fields 1..3 (spaces can be used for 4 & 5)
301.12Skre *
311.2Skre * Data may be followed by any C preprocessor #if expression (incl the #if..)
321.2Skre * (including #ifdef #ifndef) to conditionalise output for that option.
331.2Skre * The #if expression continues until \n or next following '#'
341.1Skre */
351.1Skre
361.2Skre// the POSIX defined options
371.1Skreaflag	allexport	a		# export all variables
381.1Skreeflag	errexit		e		# exit on command error ($? != 0)
391.1Skremflag	monitor		m		# enable job control
401.1SkreCflag	noclobber	C		# do not overwrite files when using >
411.1Skrenflag	noexec		n		# do not execue commands
421.1Skrefflag	noglob		f		# no pathname expansion
431.2Skreuflag	nounset		u		# expanding unset var is an error
441.2Skrevflag	verbose		v		# echo commands as read
451.2Skrexflag	xtrace		x		# trace command execution
461.2Skre
471.2Skre// the long name (ignoreeof) is standard, the I flag is not
481.2SkreIflag	ignoreeof	I		# do not exit interactive shell on EOF
491.2Skre
501.2Skre// defined but not really implemented by the shell (yet) - they do nothing
511.2Skrebflag	notify		b		# [U] report bg job completion
521.1Skrenolog	nolog				# [U] no func definitions in history
531.2Skre// 'h' is standard, long name (trackall) is not
541.2Skrehflag	trackall	h		# [U] locate cmds in funcs during defn
551.2Skre
561.2Skre// 's' is standard for command line, not as 'set' option, nor 'stdin' name
571.2Skresflag	stdin		s		# read from standard input
581.2Skre// minusc		c		# command line option only.
591.11Skre// --			r		# command line option only.
601.2Skre// --			o		# handled differently...
611.2Skre
621.2Skre// non-standard options -- 'i' is just a state, not an option in standard.
631.2Skreiflag	interactive	i		# interactive shell
641.10Skreloginsh	login		l		# a login shell
651.2Skrecdprint	cdprint				# always print result of a cd
661.2Skreusefork	fork		F		# use fork(2) instead of vfork(2)
671.1Skrepflag	nopriv		p		# preserve privs if set[ug]id
681.1Skreposix	posix				# be closer to POSIX compat
691.1Skreqflag	quietprofile	q		# disable -v/-x in startup files
701.4Skrefnline1	local_lineno	L on		# number lines in funcs starting at 1
711.12Skrepromptcmds	promptcmds		# allow $( ) in PS1 (et al).
721.12Skrepipefail	pipefail		# pipe exit status
731.9SkreXflag	xlock		X #ifndef SMALL	# sticky stderr for -x (implies -x)
741.2Skre
751.2Skre// editline/history related options ("vi" is standard, 'V' and others are not)
761.2Skre// only one of vi/emacs can be set, hence the "set" definition, value
771.2Skre// of that can be any char (not used for a different set)
781.2SkreVflag	vi		V V		# enable vi style editing
791.2SkreEflag	emacs		E V		# enable emacs style editing
801.1Skretabcomplete	tabcomplete		# make <tab> cause filename expansion
811.1Skre
821.2Skre// internal debug option (not usually included in the shell)
831.2Skredebug	debug		#ifdef DEBUG	# enable internal shell debugging
84