diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-09-17 08:19:31 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-09-17 08:19:31 +0000 |
| commit | 311a05f6138cdbbbb2208ca79e0736f0fec030a8 (patch) | |
| tree | 8a9453f19e6108fa26e9148876f3f7d8aa326bda /cli/btcli.c | |
| parent | b169d038fe2d3cc01979dd8ed6333504bbcd02f9 (diff) | |
| download | btpd-311a05f6138cdbbbb2208ca79e0736f0fec030a8.tar.gz btpd-311a05f6138cdbbbb2208ca79e0736f0fec030a8.zip | |
btcli add now starts the torrent if not told otherwise. Soem cleanup and
improved error output.
Diffstat (limited to 'cli/btcli.c')
| -rw-r--r-- | cli/btcli.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/btcli.c b/cli/btcli.c index f8b6a81..78a3313 100644 --- a/cli/btcli.c +++ b/cli/btcli.c @@ -11,15 +11,15 @@ btpd_connect(void) } enum ipc_err -handle_ipc_res(enum ipc_err code, const char *target) +handle_ipc_res(enum ipc_err code, const char *cmd, const char *target) { switch (code) { case IPC_OK: break; case IPC_COMMERR: - errx(1, "fatal error in communication with btpd"); + errx(1, "%s", ipc_strerror(code)); default: - warnx("btpd response for '%s': %s", target, ipc_strerror(code)); + warnx("%s '%s': %s", cmd, target, ipc_strerror(code)); } return code; } @@ -61,7 +61,7 @@ torrent_spec(char *arg, struct ipc_torrent *tp) return 1; } -struct { +static struct { const char *name; void (*fun)(int, char **); void (*help)(void); @@ -77,7 +77,7 @@ struct { int ncmds = sizeof(cmd_table) / sizeof(cmd_table[0]); -void +static void usage(void) { printf( @@ -104,7 +104,7 @@ usage(void) exit(1); } -struct option base_opts [] = { +static struct option base_opts [] = { { "help", no_argument, NULL, 'H' }, {NULL, 0, NULL, 0} }; |