diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-16 12:07:16 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-16 12:20:45 +0200 |
commit | 9e978b089268e6bfc4b8fcdf9ef721f6fa92c11f (patch) | |
tree | c94e728d95ecabc03f7eef76ecae6dd71bdaebf0 | |
parent | e71c1a855797de245105494a05623753e32844a4 (diff) | |
download | grecs-9e978b089268e6bfc4b8fcdf9ef721f6fa92c11f.tar.gz grecs-9e978b089268e6bfc4b8fcdf9ef721f6fa92c11f.tar.bz2 |
Add option to hide configuration statements from help output
* src/format.c (grecs_print_statement_array): Skip elements
marked with GRECS_HIDDEN flag.
* src/grecs.hin (GRECS_HIDDEN): New flag.
-rw-r--r-- | src/format.c | 2 | ||||
-rw-r--r-- | src/grecs.hin | 1 | ||||
-rw-r--r-- | src/preproc.c | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/format.c b/src/format.c index cff4019..aaad65a 100644 --- a/src/format.c +++ b/src/format.c @@ -188,6 +188,8 @@ grecs_print_statement_array(struct grecs_keyword *kwp, return; } for (; kwp->ident; kwp++, n++) { + if (kwp->flags & GRECS_HIDDEN) + continue; if (n) fputc('\n', stream); if (kwp->type == grecs_type_section) diff --git a/src/grecs.hin b/src/grecs.hin index 677a237..e4e271b 100644 --- a/src/grecs.hin +++ b/src/grecs.hin @@ -102,6 +102,7 @@ enum grecs_data_type { #define GRECS_MULT 0x02 #define GRECS_INAC 0x04 #define GRECS_LIST 0x08 +#define GRECS_HIDDEN 0x10 enum grecs_callback_command { grecs_callback_section_begin, diff --git a/src/preproc.c b/src/preproc.c index 56dcc22..9945097 100644 --- a/src/preproc.c +++ b/src/preproc.c @@ -606,8 +606,7 @@ parse_include(const char *text, int once) allow_cwd = 0; p[len - 1] = 0; p++; - } - else + } else allow_cwd = 1; if (isglob(p)) { |