NetBSD/bin/sh/option.list

80 lines
3.2 KiB
Plaintext

/* $NetBSD: option.list,v 1.9 2018/11/23 20:40:06 kre Exp $ */
/*
* define the shell's settable options
*
* new options can be defined by adding them here,
* but they do nothing until code to implement them
* is added (using the "var name" field)
*/
/*
* format is up to 5 columns... (followed by anything)
* end of line comments can be introduced by ' #' (space/tab hash) to eol.
*
* The columns are:
* 1. internal shell "var name" (required)
* 2. option long name
* if a single char, then no long name, and remaining
* columns shift left (this becomes the short name)
* 3. option short name (single character name)
* if '-' or absent then no short name
* if neither long nor short name, line is ignored
* 4. option set short name (name of option equiv class)
* if '-' or absent then no class
* 5. default value of option
* if absent, default is 0
* only 0 or 1 possible (0==off 1==on) ("on" and "off" can be used)
*
* Data may be followed by any C preprocessor #if expression (incl the #if..)
* (including #ifdef #ifndef) to conditionalise output for that option.
* The #if expression continues until \n or next following '#'
*/
// the POSIX defined options
aflag allexport a # export all variables
eflag errexit e # exit on command error ($? != 0)
mflag monitor m # enable job control
Cflag noclobber C # do not overwrite files when using >
nflag noexec n # do not execue commands
fflag noglob f # no pathname expansion
uflag nounset u # expanding unset var is an error
vflag verbose v # echo commands as read
xflag xtrace x # trace command execution
// the long name (ignoreeof) is standard, the I flag is not
Iflag ignoreeof I # do not exit interactive shell on EOF
// defined but not really implemented by the shell (yet) - they do nothing
bflag notify b # [U] report bg job completion
nolog nolog # [U] no func definitions in history
// 'h' is standard, long name (trackall) is not
hflag trackall h # [U] locate cmds in funcs during defn
// 's' is standard for command line, not as 'set' option, nor 'stdin' name
sflag stdin s # read from standard input
// minusc c # command line option only.
// -- o # handled differently...
// non-standard options -- 'i' is just a state, not an option in standard.
iflag interactive i # interactive shell
cdprint cdprint # always print result of a cd
usefork fork F # use fork(2) instead of vfork(2)
pflag nopriv p # preserve privs if set[ug]id
posix posix # be closer to POSIX compat
qflag quietprofile q # disable -v/-x in startup files
fnline1 local_lineno L on # number lines in funcs starting at 1
promptcmds promptcmds # allow $( ) in PS1 (et al).
pipefail pipefail # pipe exit status
Xflag xlock X #ifndef SMALL # sticky stderr for -x (implies -x)
// editline/history related options ("vi" is standard, 'V' and others are not)
// only one of vi/emacs can be set, hence the "set" definition, value
// of that can be any char (not used for a different set)
Vflag vi V V # enable vi style editing
Eflag emacs E V # enable emacs style editing
tabcomplete tabcomplete # make <tab> cause filename expansion
// internal debug option (not usually included in the shell)
debug debug #ifdef DEBUG # enable internal shell debugging