From ba36967b575ca57ebde3349e62c190ca69b73832 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 1 Nov 2015 18:12:40 +0000 Subject: 37038: add -l option to emulate to list options in emulations --- Src/options.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'Src/options.c') diff --git a/Src/options.c b/Src/options.c index 3bf9f39a4..2678626c7 100644 --- a/Src/options.c +++ b/Src/options.c @@ -902,3 +902,33 @@ printoptionlist_printequiv(int optno) optno *= (isneg ? -1 : 1); printf(" equivalent to --%s%s\n", isneg ? "no-" : "", optns[optno-1].node.nam); } + +/**/ +static char *print_emulate_opts; + +/**/ +static void +print_emulate_option(HashNode hn, int fully) +{ + Optname on = (Optname) hn; + + if (!(on->node.flags & OPT_ALIAS) && + ((fully && !(on->node.flags & OPT_SPECIAL)) || + (on->node.flags & OPT_EMULATE))) + { + if (!print_emulate_opts[on->optno]) + fputs("no", stdout); + puts(on->node.nam); + } +} + +/* + * List the settings of options associated with an emulation + */ + +/**/ +void list_emulate_options(char *cmdopts, int fully) +{ + print_emulate_opts = cmdopts; + scanhashtable(optiontab, 1, 0, 0, print_emulate_option, fully); +} -- cgit v1.2.3