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; }