From 8ab4820699516aabfe3507a759e2a12cf31dbc78 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 21 Nov 2010 12:00:40 +0100 Subject: [PATCH] isl_arg_parse: support ISL_ARG_HIDDEN flag Signed-off-by: Sven Verdoolaege --- include/isl/arg.h | 1 + isl_arg.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/isl/arg.h b/include/isl/arg.h index 2269bd3..ad09598 100644 --- a/include/isl/arg.h +++ b/include/isl/arg.h @@ -52,6 +52,7 @@ struct isl_arg { const char *help_msg; #define ISL_ARG_SINGLE_DASH (1 << 0) #define ISL_ARG_BOOL_ARG (1 << 1) +#define ISL_ARG_HIDDEN (1 << 2) unsigned flags; union { struct { diff --git a/isl_arg.c b/isl_arg.c index 533efac..b19778a 100644 --- a/isl_arg.c +++ b/isl_arg.c @@ -427,6 +427,8 @@ static void print_help(struct isl_arg *arg, const char *prefix) int i; for (i = 0; arg[i].type != isl_arg_end; ++i) { + if (arg[i].flags & ISL_ARG_HIDDEN) + continue; switch (arg[i].type) { case isl_arg_flags: print_flags_help(&arg[i], prefix); @@ -459,6 +461,8 @@ static void print_help(struct isl_arg *arg, const char *prefix) for (i = 0; arg[i].type != isl_arg_end; ++i) { if (arg[i].type != isl_arg_child) continue; + if (arg[i].flags & ISL_ARG_HIDDEN) + continue; printf("\n"); if (arg[i].help_msg) -- 2.7.4