From f50b9e48b93e3f69423a0e6e5fef273ba2022958 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 19 Jan 2000 14:37:56 +0000 Subject: Generate a list of all commands and their help texts for the client to use. --- conf/Makefile | 5 ++++- conf/gen_commands.m4 | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 conf/gen_commands.m4 (limited to 'conf') diff --git a/conf/Makefile b/conf/Makefile index fdcd4c38..853cd832 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -20,7 +20,10 @@ cf-parse.y: $(conf-fragments) $(conf-src)/gen_parser.m4 keywords.h: $(conf-fragments) $(conf-src)/gen_keywords.m4 $(M4) -P $(conf-src)/gen_keywords.m4 $(conf-fragments) >keywords.h +commands.h: $(conf-fragments) $(conf-src)/gen_commands.m4 + $(M4) -P $(conf-src)/gen_commands.m4 $(conf-fragments) | sort >commands.h + cf-lex.c: cf-lex.l $(FLEX) $(FLEX_DEBUG) -sB8 -ocf-lex.c -Pcf_ cf-lex.l -depend: keywords.h cf-parse.tab.c cf-lex.c +depend: keywords.h commands.h cf-parse.tab.c cf-lex.c diff --git a/conf/gen_commands.m4 b/conf/gen_commands.m4 new file mode 100644 index 00000000..cba10b40 --- /dev/null +++ b/conf/gen_commands.m4 @@ -0,0 +1,17 @@ +m4_divert(-1)m4_dnl +# +# BIRD -- Generator of CLI Command List +# +# (c) 2000 Martin Mares +# +# Can be freely distributed and used under the terms of the GNU GPL. +# + +m4_define(CF_CLI, `CF_CLI_HELP($1, $3, $4)') + +m4_define(CF_CLI_HELP, `m4_divert(0){ "m4_translit($1,A-Z,a-z)", "$2", "$3" }, +m4_divert(-1)') + +# As we are processing C source, we must access all M4 primitives via +# m4_* and also set different quoting convention: `[[' and ']]' +m4_changequote([[,]]) -- cgit v1.2.3