commit 65e53730f9e0b656e5ffe395441221fc706bd70d
parent aecf785008c3e4ce40718958b6d3bc70edd2dfce
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 28 Jul 2012 00:15:04 +0200
improve usage message
Diffstat:
irctk.c | | | 43 | ++++++++++++++++++------------------------- |
1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/irctk.c b/irctk.c
@@ -41,17 +41,12 @@ enum track {NO, YES, UNIQUE};
const char *argp_program_version = "irctk 0.1";
const char *argp_program_bug_address = "<a3nm@a3nm.net>";
-/* Program documentation. */
-static char doc[] =
- "irctk -- an IRC toolkit";
-
-/* A description of the arguments we accept. */
+static char doc[] = "irctk -- an IRC toolkit";
static char args_doc[] = "[NICK[:PASS]@]SERVER[:PORT] [CHANNEL[:PASS]]...";
-enum arg_types {STANDARD, MISC, COM_MODE, CHANNEL_SELECTION, BOT_OPTIONS,
- TRACKING, DISPLAY_SELECTION, PARSING, NAME};
+enum arg_types {STANDARD, TIMING, MISC, COM_MODE, CHANNEL_SELECTION, BOT_OPTIONS,
+ TRACKING, PARSING, DISPLAY_SELECTION, NAME};
-/* The options we understand. */
static struct argp_option options[] = {
{"verbose", 'v', 0, 0,
@@ -61,22 +56,21 @@ static struct argp_option options[] = {
"Don't display errors on stderr, fail silently",
STANDARD},
- /* TODOponey ideally should not delay for bots, only for things piped, is there a
- * better way such as only waiting at the end? */
{"interval", 'i', "secs", 0,
"Wait delay between posted messages (default: 0 for tty stdin, 1 for"
" file/pipe)",
- MISC},
+ TIMING},
{"interval-end", 'I', "secs", 0,
"Wait delay between sending the last message and disconnecting"
" (default: 2)",
- MISC},
+ TIMING},
{"retry-after", 'y', "secs", 0,
"Wait delay before trying to reconnect (default: 5)",
- MISC},
+ TIMING},
{"retry-factor", 'Y', "secs", 0,
"Retry delay multiplication factor after each failed attempt (default: 2)",
- MISC},
+ TIMING},
+
{"auto-join", 'j', 0, 0,
"Automatically join and re-join channels as needed (default)", MISC },
{"no-auto-join", 'J', 0, 0,
@@ -132,14 +126,6 @@ static struct argp_option options[] = {
"Track nick changes and expose unique names for users",
TRACKING },
- /* TODO test, and make compatible with --own */
- {"with-host", 'w', 0, 0,
- "Keep the host info in pseudos",
- DISPLAY_SELECTION},
- {"own", 'o', 0, 0,
- "Also display messages posted by self",
- DISPLAY_SELECTION},
-
{"event-to-nothing", 'n', 0, 0,
"Ignore server events (default).",
PARSING},
@@ -149,13 +135,20 @@ static struct argp_option options[] = {
{"event-to-message", 'm', 0, 0,
"Translate server events to a human-readable description",
PARSING},
+
{"command-to-event", 'e', 0, 0,
"Interpret messages starting with \"/quit\", \"/me\", etc. as commands"
" unless escaped (default)",
- PARSING, },
+ DISPLAY_SELECTION, },
{"no-command-to-event", 'E', 0, 0,
"Don't generate events from messages with \"/quit\", \"/me\"...",
- PARSING, },
+ DISPLAY_SELECTION, },
+ {"with-host", 'w', 0, 0,
+ "Keep the host info in pseudos",
+ DISPLAY_SELECTION},
+ {"own", 'o', 0, 0,
+ "Include own messages in output",
+ DISPLAY_SELECTION},
{"username", 'U', "name", 0,
"Unix username (default: same as nick)",
@@ -164,7 +157,7 @@ static struct argp_option options[] = {
"Full name (default: same as nick)",
NAME},
{"force-nick", 'N', 0, 0,
- "Abort when the intended nick is unavailable or invalid instead of picking"
+ "Abort when the requested nick is unavailable or invalid; don't pick"
" another one automatically",
NAME},