From 8f8481856595c6e87bd04a5fe991cec03dcf9daa Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Wed, 5 Oct 2011 20:10:52 +1100 Subject: [PATCH] + added usage information --- src/torrent2json.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/torrent2json.c b/src/torrent2json.c index 7d16828..9280d07 100644 --- a/src/torrent2json.c +++ b/src/torrent2json.c @@ -15,6 +15,19 @@ struct yajl_gen_t *gen = NULL; void (*select_handler(int))(int); +void +usage(int exitcode) +{ + fprintf(stderr, "\ +Usage: torrent2json []\n\ +Where options are:\n\ + -h This help.\n\ + -i Input file. (Default: read from stdin)\n\ + -o Output file. (Default: write to stdout)\n\ + -c Compact json. (Default: no)\n"); + exit(exitcode); +} + /* handlers */ void get_integer(int chr)