From 807c5de5e288f827e00df98ae8e6b321323fc9ec Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 4 Aug 2010 23:18:39 +0000 Subject: [PATCH] (trunk cli) #3487 "transmissioncli should warn about about unrecognized commands" -- fixed. --- cli/cli.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/cli.c b/cli/cli.c index 18c168bca..e07089788 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -265,6 +265,12 @@ main( int argc, char ** argv ) tr_webRun( h, torrentPath, NULL, onTorrentFileDownloaded, ctor ); waitingOnWeb = TRUE; while( waitingOnWeb ) tr_wait_msec( 1000 ); + } else { + fprintf( stderr, "ERROR: Unrecognized torrent \"%s\".\n", torrentPath ); + fprintf( stderr, " * If you're trying to create a torrent, use transmission-create.\n" ); + fprintf( stderr, " * If you're trying to see a torrent's info, use transmission-show.\n" ); + tr_sessionClose( h ); + return EXIT_FAILURE; } tr_free( fileContents ); @@ -394,7 +400,8 @@ parseCommandLine( tr_benc * d, int argc, const char ** argv ) case 912: tr_bencDictAddInt( d, TR_PREFS_KEY_ENCRYPTION, TR_CLEAR_PREFERRED ); break; case TR_OPT_UNK: - torrentPath = optarg; + if( torrentPath == NULL ) + torrentPath = optarg; break; default: return 1; } -- 2.40.0