xref: /titanic_50/usr/src/lib/libshell/common/data/options.c (revision e4b86885570d77af552e9cf94f142f4d744fb8c8)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *           Copyright (c) 1982-2007 AT&T Knowledge Ventures            *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                      by AT&T Knowledge Ventures                      *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                  David Korn <dgk@research.att.com>                   *
18 *                                                                      *
19 ***********************************************************************/
20 #pragma prototyped
21 
22 #include	<defs.h>
23 #include	"FEATURE/options"
24 #include	"name.h"
25 #include	"shtable.h"
26 
27 #if SHOPT_BASH
28 #   define bashopt(a,b)	a,	b|SH_BASHOPT,
29 #   define bashextra(a,b)	a,	b|SH_BASHEXTRA,
30 #else
31 #   define bashopt(a,b)
32 #   define bashextra(a,b)
33 #endif
34 
35 /*
36  * This is the list of invocation and set options
37  * This list must be in in ascii sorted order
38  */
39 
40 const Shtable_t shtab_options[] =
41 {
42 	"allexport",			SH_ALLEXPORT,
43 #if SHOPT_BASH
44 	"bash",				(SH_BASH|SH_COMMANDLINE),
45 #endif
46 	"bgnice",			SH_BGNICE,
47 	"braceexpand",			SH_BRACEEXPAND,
48 	bashopt("cdable_vars",		SH_CDABLE_VARS)
49 	bashopt("cdspell",		SH_CDSPELL)
50 	bashopt("checkhash",		SH_CHECKHASH)
51 	bashopt("checkwinsize",		SH_CHECKWINSIZE)
52 	"noclobber",			SH_NOCLOBBER,
53 	bashopt("dotglob",		SH_DOTGLOB)
54 	"emacs",			SH_EMACS,
55 	"errexit",			SH_ERREXIT,
56 	"noexec",			SH_NOEXEC,
57 	bashopt("execfail",		SH_EXECFAIL)
58 	bashopt("expand_aliases",	SH_EXPAND_ALIASES)
59 	bashopt("extglob",		SH_EXTGLOB)
60 	"noglob",			SH_NOGLOB,
61 	"globstar",			SH_GLOBSTARS,
62 	"gmacs",			SH_GMACS,
63 	bashextra("hashall",		SH_TRACKALL)
64 	bashopt("histappend",		SH_HISTAPPEND)
65 #if SHOPT_HISTEXPAND
66 	"histexpand",			SH_HISTEXPAND,
67 #else
68 	bashextra("histexpand",		SH_HISTEXPAND)
69 #endif
70 	bashextra("history",		SH_HISTORY2)
71 	bashopt("histreedit",		SH_HISTREEDIT)
72 	bashopt("histverify",		SH_HISTVERIFY)
73 	bashopt("hostcomplete",		SH_HOSTCOMPLETE)
74 	bashopt("huponexit",		SH_HUPONEXIT)
75 	"ignoreeof",			SH_IGNOREEOF,
76 	"interactive",			SH_INTERACTIVE|SH_COMMANDLINE,
77 	bashextra("interactive_comments",	SH_INTERACTIVE_COMM)
78 	"keyword",			SH_KEYWORD,
79 	bashopt("lithist",		SH_LITHIST)
80 	"nolog",			SH_NOLOG,
81 	"login_shell",			SH_LOGIN_SHELL|SH_COMMANDLINE,
82 	bashopt("mailwarn",		SH_MAILWARN)
83 	"markdirs",			SH_MARKDIRS,
84 	"monitor",			SH_MONITOR,
85 	"multiline",			SH_MULTILINE,
86 	bashopt("no_empty_cmd_completion", SH_NOEMPTYCMDCOMPL)
87 	bashopt("nocaseglob",		SH_NOCASEGLOB)
88 	"notify",			SH_NOTIFY,
89 	bashopt("nullglob",		SH_NULLGLOB)
90 	bashextra("onecmd",		SH_TFLAG)
91 	"pipefail",			SH_PIPEFAIL,
92 	bashextra("physical",		SH_PHYSICAL)
93 	bashextra("posix",		SH_POSIX)
94 	"privileged",			SH_PRIVILEGED,
95 #if SHOPT_PFSH
96 	"profile",			SH_PFSH|SH_COMMANDLINE,
97 #endif
98 	bashopt("progcomp",		SH_PROGCOMP)
99 	bashopt("promptvars",		SH_PROMPTVARS)
100 	"rc",				SH_RC|SH_COMMANDLINE,
101 	"restricted",			SH_RESTRICTED,
102 	bashopt("restricted_shell",	SH_RESTRICTED2|SH_COMMANDLINE)
103 	bashopt("shift_verbose",	SH_SHIFT_VERBOSE)
104 	"showme",			SH_SHOWME,
105 	bashopt("sourcepath",		SH_SOURCEPATH)
106 	"trackall",			SH_TRACKALL,
107 	"nounset",			SH_NOUNSET,
108 	"verbose",			SH_VERBOSE,
109 	"vi",				SH_VI,
110 	"viraw",			SH_VIRAW,
111 	bashopt("xpg_echo",		SH_XPG_ECHO)
112 	"xtrace",			SH_XTRACE,
113 	"",				0
114 };
115 
116 const Shtable_t shtab_attributes[] =
117 {
118 	{"-nnameref",	NV_REF},
119 	{"-xexport",	NV_EXPORT},
120 	{"-rreadonly",	NV_RDONLY},
121 	{"-ttagged",	NV_TAGGED},
122 	{"-llong",	(NV_INTEGER|NV_DOUBLE|NV_LONG)},
123 	{"-Eexponential",(NV_INTEGER|NV_DOUBLE|NV_EXPNOTE)},
124 	{"-Ffloat",	(NV_INTEGER|NV_DOUBLE)},
125 	{"-llong",	(NV_INTEGER|NV_LONG)},
126 	{"-sshort",	(NV_INTEGER|NV_SHORT)},
127 	{"-uunsigned",	(NV_INTEGER|NV_UNSIGN)},
128 	{"-iinteger",	NV_INTEGER},
129 	{"-Hfilename",	NV_HOST},
130 	{"-bbinary",    NV_BINARY},
131 	{"-llowercase",	NV_UTOL},
132 	{"-Zzerofill",	NV_ZFILL},
133 	{"-Lleftjust",	NV_LJUST},
134 	{"-Rrightjust",	NV_RJUST},
135 	{"-uuppercase",	NV_LTOU},
136 	{"-Aassociative array",	NV_ARRAY},
137 	{"-aindexed array",	NV_ARRAY},
138 	{"++namespace",	NV_TABLE},
139 	{"",		0}
140 };
141