From 2d752320d61b46a65ebb9fa754033f250f097cd3 Mon Sep 17 00:00:00 2001 Message-Id: <2d752320d61b46a65ebb9fa754033f250f097cd3.1715113624.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 2 Oct 2004 09:38:48 +0000 Subject: [PATCH] Use standard GNU uppercase for metavariables in usage strings. Some manpage fixing. Write mallory's help message. Organization: Straylight/Edgeware From: mdw --- admin.c | 24 ++++++++++++------------ client.c | 10 +++++----- doc/tripe-admin.5 | 1 + doc/tripe-mitm.8 | 2 +- mallory.c | 26 ++++++++++++++++++++++++-- tripe.c | 8 ++++---- 6 files changed, 47 insertions(+), 24 deletions(-) diff --git a/admin.c b/admin.c index bca525d8..b95db51c 100644 --- a/admin.c +++ b/admin.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: admin.c,v 1.10 2004/04/08 01:36:17 mdw Exp $ + * $Id$ * * Admin interface for configuration * @@ -641,19 +641,19 @@ typedef struct acmd { static void acmd_help(admin */*a*/, unsigned /*ac*/, char */*av*/[]); static const acmd acmdtab[] = { - { "help", "HELP", 0, 0, acmd_help }, + { "help", "help", 0, 0, acmd_help }, #ifndef NTRACE - { "trace", "TRACE [options]", 0, 1, acmd_trace }, + { "trace", "trace [OPTIONS]", 0, 1, acmd_trace }, #endif - { "port", "PORT", 0, 0, acmd_port }, - { "daemon", "DAEMON", 0, 0, acmd_daemon }, - { "list", "LIST", 0, 0, acmd_list }, - { "ifname", "IFNAME peer", 1, 1, acmd_ifname }, - { "addr", "ADDR peer", 1, 1, acmd_addr }, - { "stats", "STATS peer", 1, 1, acmd_stats }, - { "kill", "KILL peer", 1, 1, acmd_kill }, - { "add", "ADD peer addr port", 3, 3, acmd_add }, - { "quit", "QUIT", 0, 0, acmd_quit }, + { "port", "port", 0, 0, acmd_port }, + { "daemon", "daemon", 0, 0, acmd_daemon }, + { "list", "list", 0, 0, acmd_list }, + { "ifname", "ifname PEER", 1, 1, acmd_ifname }, + { "addr", "addr PEER", 1, 1, acmd_addr }, + { "stats", "stats PEER", 1, 1, acmd_stats }, + { "kill", "kill PEER", 1, 1, acmd_kill }, + { "add", "add PEER ADDR PORT", 3, 3, acmd_add }, + { "quit", "quit", 0, 0, acmd_quit }, { 0, 0, 0, 0, 0 } }; diff --git a/client.c b/client.c index 45dbd7bd..7edc790b 100644 --- a/client.c +++ b/client.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: client.c,v 1.14 2004/04/08 01:36:17 mdw Exp $ + * $Id$ * * Client for TrIPE * @@ -222,11 +222,11 @@ static void usage(FILE *fp) { pquis(fp, "\ Usage:\n\ - $ [-w] [-options] [command [args]...]\n\ - $ [-Dl] [-f file] [-options]\n\ + $ [-w] [-OPTIONS] [COMMAND [ARGS]...]\n\ + $ [-Dl] [-f FILE] [-OPTIONS]\n\ Options:\n\ - [-s] [-d directory] [-a socket] [-P pidfile]\n\ - [-p program] [-S arg,arg,...]\n\ + [-s] [-d DIRECTORY] [-a SOCKET] [-P PIDFILE]\n\ + [-p PROGRAM] [-S ARG,ARG,...]\n\ "); } diff --git a/doc/tripe-admin.5 b/doc/tripe-admin.5 index 70c793d7..f762692e 100644 --- a/doc/tripe-admin.5 +++ b/doc/tripe-admin.5 @@ -90,6 +90,7 @@ given, a table is returned showing the available tracing option letters and their meanings. Programs should not attempt to parse this table: its format is not guaranteed to remain the same. .RS +.PP Currently, the following tracing options are supported: .TP .B t diff --git a/doc/tripe-mitm.8 b/doc/tripe-mitm.8 index 7c79d8a3..5275bf06 100644 --- a/doc/tripe-mitm.8 +++ b/doc/tripe-mitm.8 @@ -125,7 +125,7 @@ Apply a given filter to packets received from the left peer. .BI lfilt: filter : args :\fR... Apply a given filter to packets received from the right peer. .TP -.B next: tag :\fR... +.BI next: tag :\fR... Begin the next branch of the first fork filter node named .I tag in each filter chain. See below for more about filter chains. diff --git a/mallory.c b/mallory.c index 6a2768cc..5078b9b5 100644 --- a/mallory.c +++ b/mallory.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mallory.c,v 1.4 2004/04/08 01:36:17 mdw Exp $ + * $Id$ * * An evil proxy for TrIPE * @@ -610,7 +610,7 @@ static void version(FILE *fp) static void usage(FILE *fp) { - pquis(fp, "Usage: $ [-k keyring] directive...\n"); + pquis(fp, "Usage: $ [-k KEYRING] DIRECTIVE...\n"); } static void help(FILE *fp) @@ -618,6 +618,28 @@ static void help(FILE *fp) version(fp); putc('\n', fp); usage(fp); + fputs("\n\ +Options: + +-h, --help Show this help text. +-v, --version Show the version number. +-u, --usage Show terse usage summary. + +-k, --keyring=FILE Fetch keys from FILE. + +Directives:\n\ + peer:NAME:LOCAL-PORT:REMOTE-ADDR:REMOTE-PORT\n\ + include:FILE\n\ + {,l,r}filt:FILTER:ARGS:...\n\ + next:TAG\n\ + {,l,r}flood:TYPE:MILLIS:SIZE\n\ +\n\ +Filters:\n\ + send\n\ + fork:TAG\n\ + delay:QLEN[:MILLIS:P-REPLAY]\n\ + corrupt[:P-CORRUPT]\n", + fp); } int main(int argc, char *argv[]) diff --git a/tripe.c b/tripe.c index e2356ebb..0ba169b2 100644 --- a/tripe.c +++ b/tripe.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: tripe.c,v 1.15 2004/04/19 08:49:40 mdw Exp $ + * $Id$ * * Main program * @@ -74,9 +74,9 @@ void interval(struct timeval *tv, void *v) static void usage(FILE *fp) { - pquis(fp, "Usage: $ [-D] [-d dir] [-b addr] [-p port]\n\ - [-U user] [-G group] [-a socket] [-T trace-opts]\n\ - [-k priv-keyring] [-K pub-keyring] [-t key-tag]\n"); + pquis(fp, "Usage: $ [-D] [-d DIR] [-b ADDR] [-p PORT]\n\ + [-U USER] [-G GROUP] [-a SOCKET] [-T TRACE-OPTS]\n\ + [-k PRIV-KEYRING] [-K PUB-KEYRING] [-t KEY-TAG]\n"); } static void version(FILE *fp) -- [mdw]