2009-09-20 18:40:58 +02:00
|
|
|
#if defined(SHFLAGS_DEFNS)
|
2013-05-02 22:28:15 +02:00
|
|
|
__RCSID("$MirOS: src/bin/mksh/sh_flags.h,v 1.14 2013/05/02 20:28:15 tg Exp $");
|
2009-09-20 18:40:58 +02:00
|
|
|
#define FN(sname,cname,ochar,flags) /* nothing */
|
|
|
|
#elif defined(SHFLAGS_ENUMS)
|
|
|
|
#define FN(sname,cname,ochar,flags) cname,
|
|
|
|
#define F0(sname,cname,ochar,flags) cname = 0,
|
|
|
|
#elif defined(SHFLAGS_ITEMS)
|
|
|
|
#define FN(sname,cname,ochar,flags) { sname, ochar, flags },
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef F0
|
|
|
|
#define F0 FN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* special cases (see parse_args()): -A, -o, -s
|
|
|
|
*
|
|
|
|
* options are sorted by their longnames
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* -a all new parameters are created with the export attribute */
|
|
|
|
F0("allexport", FEXPORT, 'a', OF_ANY)
|
|
|
|
|
|
|
|
#if HAVE_NICE
|
|
|
|
/* ./. bgnice */
|
|
|
|
FN("bgnice", FBGNICE, 0, OF_ANY)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* ./. enable {} globbing (non-standard) */
|
|
|
|
FN("braceexpand", FBRACEEXPAND, 0, OF_ANY)
|
|
|
|
|
2012-06-28 22:14:17 +02:00
|
|
|
#if !defined(MKSH_NO_CMDLINE_EDITING) || defined(MKSH_LEGACY_MODE)
|
2009-09-20 18:40:58 +02:00
|
|
|
/* ./. Emacs command line editing mode */
|
|
|
|
FN("emacs", FEMACS, 0, OF_ANY)
|
2012-05-04 22:49:08 +02:00
|
|
|
#endif
|
2009-09-20 18:40:58 +02:00
|
|
|
|
|
|
|
/* -e quit on error */
|
|
|
|
FN("errexit", FERREXIT, 'e', OF_ANY)
|
|
|
|
|
2012-06-28 22:14:17 +02:00
|
|
|
#if !defined(MKSH_NO_CMDLINE_EDITING) || defined(MKSH_LEGACY_MODE)
|
2009-09-20 18:40:58 +02:00
|
|
|
/* ./. Emacs command line editing mode, gmacs variant */
|
|
|
|
FN("gmacs", FGMACS, 0, OF_ANY)
|
2012-05-04 22:49:08 +02:00
|
|
|
#endif
|
2009-09-20 18:40:58 +02:00
|
|
|
|
|
|
|
/* ./. reading EOF does not exit */
|
|
|
|
FN("ignoreeof", FIGNOREEOF, 0, OF_ANY)
|
|
|
|
|
|
|
|
/* -i interactive shell */
|
|
|
|
FN("interactive", FTALKING, 'i', OF_CMDLINE)
|
|
|
|
|
|
|
|
/* -k name=value are recognised anywhere */
|
|
|
|
FN("keyword", FKEYWORD, 'k', OF_ANY)
|
|
|
|
|
|
|
|
/* -l login shell */
|
|
|
|
FN("login", FLOGIN, 'l', OF_CMDLINE)
|
|
|
|
|
|
|
|
/* -X mark dirs with / in file name completion */
|
|
|
|
FN("markdirs", FMARKDIRS, 'X', OF_ANY)
|
|
|
|
|
|
|
|
#ifndef MKSH_UNEMPLOYED
|
|
|
|
/* -m job control monitoring */
|
|
|
|
FN("monitor", FMONITOR, 'm', OF_ANY)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* -C don't overwrite existing files */
|
|
|
|
FN("noclobber", FNOCLOBBER, 'C', OF_ANY)
|
|
|
|
|
|
|
|
/* -n don't execute any commands */
|
|
|
|
FN("noexec", FNOEXEC, 'n', OF_ANY)
|
|
|
|
|
|
|
|
/* -f don't do file globbing */
|
|
|
|
FN("noglob", FNOGLOB, 'f', OF_ANY)
|
|
|
|
|
|
|
|
/* ./. don't kill running jobs when login shell exits */
|
|
|
|
FN("nohup", FNOHUP, 0, OF_ANY)
|
|
|
|
|
|
|
|
/* ./. don't save functions in history (no effect) */
|
|
|
|
FN("nolog", FNOLOG, 0, OF_ANY)
|
|
|
|
|
|
|
|
#ifndef MKSH_UNEMPLOYED
|
|
|
|
/* -b asynchronous job completion notification */
|
|
|
|
FN("notify", FNOTIFY, 'b', OF_ANY)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* -u using an unset variable is an error */
|
|
|
|
FN("nounset", FNOUNSET, 'u', OF_ANY)
|
|
|
|
|
|
|
|
/* ./. don't do logical cds/pwds (non-standard) */
|
|
|
|
FN("physical", FPHYSICAL, 0, OF_ANY)
|
|
|
|
|
2013-05-02 22:28:15 +02:00
|
|
|
/* ./. errorlevel of a pipeline is the rightmost nonzero value */
|
|
|
|
FN("pipefail", FPIPEFAIL, 0, OF_ANY)
|
|
|
|
|
2013-05-02 22:21:45 +02:00
|
|
|
/* ./. adhere more closely to POSIX even when undesirable */
|
2010-01-28 16:18:51 +01:00
|
|
|
FN("posix", FPOSIX, 0, OF_ANY)
|
|
|
|
|
2009-09-20 18:40:58 +02:00
|
|
|
/* -p use suid_profile; privileged shell */
|
|
|
|
FN("privileged", FPRIVILEGED, 'p', OF_ANY)
|
|
|
|
|
|
|
|
/* -r restricted shell */
|
|
|
|
FN("restricted", FRESTRICTED, 'r', OF_CMDLINE)
|
|
|
|
|
2013-05-02 22:21:45 +02:00
|
|
|
/* ./. kludge mode for better compat with traditional sh (OS-specific) */
|
2009-10-02 20:08:37 +02:00
|
|
|
FN("sh", FSH, 0, OF_ANY)
|
|
|
|
|
2009-09-20 18:40:58 +02:00
|
|
|
/* -s (invocation) parse stdin (pseudo non-standard) */
|
|
|
|
FN("stdin", FSTDIN, 's', OF_CMDLINE)
|
|
|
|
|
|
|
|
/* -h create tracked aliases for all commands */
|
|
|
|
FN("trackall", FTRACKALL, 'h', OF_ANY)
|
|
|
|
|
|
|
|
/* -U enable UTF-8 processing (non-standard) */
|
|
|
|
FN("utf8-mode", FUNICODE, 'U', OF_ANY)
|
|
|
|
|
|
|
|
/* -v echo input */
|
|
|
|
FN("verbose", FVERBOSE, 'v', OF_ANY)
|
|
|
|
|
2012-06-28 22:14:17 +02:00
|
|
|
#if !defined(MKSH_NO_CMDLINE_EDITING) || defined(MKSH_LEGACY_MODE)
|
2009-09-20 18:40:58 +02:00
|
|
|
/* ./. Vi command line editing mode */
|
|
|
|
FN("vi", FVI, 0, OF_ANY)
|
|
|
|
|
|
|
|
/* ./. enable ESC as file name completion character (non-standard) */
|
|
|
|
FN("vi-esccomplete", FVIESCCOMPLETE, 0, OF_ANY)
|
|
|
|
|
|
|
|
/* ./. enable Tab as file name completion character (non-standard) */
|
|
|
|
FN("vi-tabcomplete", FVITABCOMPLETE, 0, OF_ANY)
|
|
|
|
|
|
|
|
/* ./. always read in raw mode (no effect) */
|
|
|
|
FN("viraw", FVIRAW, 0, OF_ANY)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* -x execution trace (display commands as they are run) */
|
|
|
|
FN("xtrace", FXTRACE, 'x', OF_ANY)
|
|
|
|
|
|
|
|
/* -c (invocation) execute specified command */
|
|
|
|
FN(NULL, FCOMMAND, 'c', OF_CMDLINE)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* anonymous flags: used internally by shell only (not visible to user)
|
|
|
|
*/
|
|
|
|
|
• more comment and int→bool cleanup, add and improve some comments
• in interactive mode, always look up {LC_{ALL,CTYPE},LANG} environment
variables if setlocale/nl_langinfo(CODESET) doesn’t suffice
• add the ability to call any builtin (some don't make sense or wouldn't
work) directly by analysing argv[0]
• for direct builtin calls, the {LC_{ALL,CTYPE},LANG} environment
variables determine utf8-mode, even if MKSH_ASSUME_UTF8 was set
• when called as builtin, echo behaves POSIXish
• add domainname as alias for true on MirBSD only, to be able to link it
• sync mksh Makefiles with Build.sh output
• adjust manpage wrt release plans
• link some things to mksh now that we have callable builtins:
bin/echo bin/kill bin/pwd bin/sleep (exact matches)
bin/test bin/[ (were scripts before)
bin/domainname=usr/bin/true usr/bin/false (move to /bin/ now)
• drop linked utilities and, except for echo and kill, their manpages
• adjust instbin and link a few more there as well
2011-02-11 02:18:23 +01:00
|
|
|
/* ./. direct builtin call (divined from argv[0] multi-call binary) */
|
|
|
|
FN(NULL, FAS_BUILTIN, 0, OF_INTERNAL)
|
|
|
|
|
2009-09-20 18:40:58 +02:00
|
|
|
/* ./. (internal) initial shell was interactive */
|
|
|
|
FN(NULL, FTALKING_I, 0, OF_INTERNAL)
|
|
|
|
|
|
|
|
#undef FN
|
|
|
|
#undef F0
|
|
|
|
#undef SHFLAGS_DEFNS
|
|
|
|
#undef SHFLAGS_ENUMS
|
|
|
|
#undef SHFLAGS_ITEMS
|