diff --git a/src/json2torrent.c b/src/json2torrent.c index 7a74d04..c041c3b 100644 --- a/src/json2torrent.c +++ b/src/json2torrent.c @@ -17,6 +17,18 @@ struct yajl_gen_t *gen = NULL; #define BUF_SIZE (64 * 1024) +void +usage(int exitcode) +{ + fprintf(stderr, "\ +Usage: json2torrent []\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"); + exit(exitcode); +} + static int write_integer(void *ctx, long long l) { return (fprintf(out, "i%llie", l) > 0 ? 1 : 0); }