From 9e978b089268e6bfc4b8fcdf9ef721f6fa92c11f Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Wed, 16 Dec 2015 12:07:16 +0200 Subject: 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. --- src/format.c | 2 ++ src/grecs.hin | 1 + src/preproc.c | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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)) { -- cgit v1.2.1