Browse Source

+ added usage information

master
Alex 'AdUser' Z 13 years ago
parent
commit
cbd11eef60
  1. 12
      src/json2torrent.c

12
src/json2torrent.c

@ -17,6 +17,18 @@ struct yajl_gen_t *gen = NULL;
#define BUF_SIZE (64 * 1024) #define BUF_SIZE (64 * 1024)
void
usage(int exitcode)
{
fprintf(stderr, "\
Usage: json2torrent [<options>]\n\
Where options are:\n\
-h This help.\n\
-i <file> Input file. (Default: read from stdin)\n\
-o <file> Output file. (Default: write to stdout)\n");
exit(exitcode);
}
static int static int
write_integer(void *ctx, long long l) write_integer(void *ctx, long long l)
{ return (fprintf(out, "i%llie", l) > 0 ? 1 : 0); } { return (fprintf(out, "i%llie", l) > 0 ? 1 : 0); }

Loading…
Cancel
Save