/* * This file Copyright (C) 2008-2010 Mnemosyne LLC * * This file is licensed by the GPL version 2. Works owned by the * Transmission project are granted a special exemption to clause 2(b) * so that the bulk of its code can remain under the MIT license. * This exemption does not extend to derived works not owned by * the Transmission project. * * $Id$ */ #include /* isspace */ #include #include #include #include #include /* strcmp */ #ifdef WIN32 #include /* getcwd */ #else #include /* getcwd */ #endif #include #define CURL_DISABLE_TYPECHECK /* otherwise -Wunreachable-code goes insane */ #include #include #include #include #include #include #include #include #define MY_NAME "transmission-remote" #define DEFAULT_HOST "localhost" #define DEFAULT_PORT atoi(TR_DEFAULT_RPC_PORT_STR) enum { TAG_SESSION, TAG_STATS, TAG_LIST, TAG_DETAILS, TAG_FILES, TAG_PEERS }; static const char* getUsage( void ) { return "Transmission " LONG_VERSION_STRING " http://www.transmissionbt.com/\n" "A fast and easy BitTorrent client\n" "\n" "Usage: " MY_NAME " [host] [options]\n" " " MY_NAME " [port] [options]\n" " " MY_NAME " [host:port] [options]\n" "\n" "See the man page for detailed explanations and many examples."; } static tr_option opts[] = { { 'a', "add", "Add torrent files by filename or URL", "a", 0, NULL }, { 970, "alt-speed", "Use the alternate Limits", "as", 0, NULL }, { 971, "no-alt-speed", "Don't use the alternate Limits", "AS", 0, NULL }, { 972, "alt-speed-downlimit", "max alternate download speed (in KB/s)", "asd", 1, "" }, { 973, "alt-speed-uplimit", "max alternate upload speed (in KB/s)", "asu", 1, "" }, { 974, "alt-speed-scheduler", "Use the scheduled on/off times", "asc", 0, NULL }, { 975, "no-alt-speed-scheduler","Don't use the scheduled on/off times", "ASC", 0, NULL }, { 976, "alt-speed-time-begin", "Time to start using the alt speed limits (in hhmm)", NULL, 1, "