From 1ed9e15ee0d00258798b1abcd2dbded7d169a72f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 3 Feb 2008 07:03:40 +0000 Subject: [PATCH] #670 "transmission-remote -x (core dumped)" patch by joshe --- daemon/remote.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 9d58ac3e5..b5e8c1042 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -225,7 +225,8 @@ usage( const char * msg, ... ) } printf( - "usage: %s [options]\n" + "usage: %s [options] [files...]\n" + " %s -x [options] proxy-command [args...]\n" "\n" "Transmission %s http://www.transmissionbt.com/\n" "A fast and easy BitTorrent client\n" @@ -257,7 +258,7 @@ usage( const char * msg, ... ) " -u --upload-limit Max upload rate in KiB/s\n" " -U --upload-unlimited No upload rate limit\n" " -x --proxy Use proxy command to connect to frontend\n", - getmyname(), LONG_VERSION_STRING ); + getmyname(), getmyname(), LONG_VERSION_STRING ); exit( 0 ); } @@ -411,7 +412,7 @@ readargs( int argc, char ** argv, struct opts * opts ) break; case 'x': opts->proxy = 1; - break; + continue; /* don't set gotmsg, -x isn't a message */ default: usage( NULL ); break; @@ -426,6 +427,8 @@ readargs( int argc, char ** argv, struct opts * opts ) if( opts->proxy ) { + if( argc == optind ) + usage( "can't use -x without any arguments" ); opts->proxycmd = argv + optind; } else if( 0 > fileargs( &opts->files, argc - optind, argv + optind ) )