Hi,
By default we have:
# relayctl show
missing argument:
valid commands/args:
summary
hosts
redirects
relays
routers
sessions
On the other hand:
# relayctl host
usage: relayctl [-s socket] command [argument ...]
# relayctl host dis
missing argument:
valid commands/args:
<hostid>
I think it's better if it is like:
# ./relayctl host
missing argument:
valid commands/args:
disable
enable
same for table, redirect
If this is accepted maybe NOTOKEN can be completely removed from code.
regards,
G
Index: parser.c
===================================================================
RCS file: /cvs/src/usr.sbin/relayctl/parser.c,v
retrieving revision 1.27
diff -u -p -r1.27 parser.c
--- parser.c 22 Jan 2015 17:42:09 -0000 1.27
+++ parser.c 11 May 2018 10:52:11 -0000
@@ -81,21 +81,18 @@ static const struct token t_show[] = {
};
static const struct token t_rdr[] = {
- {NOTOKEN, "", NONE, NULL},
{KEYWORD, "disable", RDR_DISABLE, t_rdr_id},
{KEYWORD, "enable", RDR_ENABLE, t_rdr_id},
{ENDTOKEN, "", NONE, NULL}
};
static const struct token t_table[] = {
- {NOTOKEN, "", NONE, NULL},
{KEYWORD, "disable", TABLE_DISABLE, t_table_id},
{KEYWORD, "enable", TABLE_ENABLE, t_table_id},
{ENDTOKEN, "", NONE, NULL}
};
static const struct token t_host[] = {
- {NOTOKEN, "", NONE, NULL},
{KEYWORD, "disable", HOST_DISABLE, t_host_id},
{KEYWORD, "enable", HOST_ENABLE, t_host_id},
{ENDTOKEN, "", NONE, NULL}