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