mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
Set deprecated commands to be off by default. If needed use the '-D' option, however note that they will be removed permanently in the future.
This commit is contained in:
@@ -438,7 +438,7 @@ cmd_catch(rpc::target_type target, const torrent::Object& args) {
|
||||
|
||||
void
|
||||
initialize_command_dynamic() {
|
||||
CMD2_VAR_BOOL ("method.use_deprecated", true);
|
||||
CMD2_VAR_BOOL ("method.use_deprecated", false);
|
||||
CMD2_VAR_VALUE ("method.use_intermediate", 1);
|
||||
|
||||
CMD2_ANY_LIST ("method.insert", tr1::bind(&system_method_insert, tr1::placeholders::_2));
|
||||
|
||||
+14
-12
@@ -230,7 +230,7 @@ main(int argc, char** argv) {
|
||||
initialize_commands();
|
||||
|
||||
if (OptionParser::has_flag('D', argc, argv)) {
|
||||
rpc::call_command_set_value("method.use_deprecated.set", false);
|
||||
rpc::call_command_set_value("method.use_deprecated.set", true);
|
||||
lt_log_print(torrent::LOG_WARN, "Disabled deprecated commands.");
|
||||
}
|
||||
|
||||
@@ -397,8 +397,20 @@ main(int argc, char** argv) {
|
||||
CMD2_REDIRECT_GENERIC("directory", "directory.default.set");
|
||||
CMD2_REDIRECT_GENERIC("session", "session.path.set");
|
||||
|
||||
CMD2_REDIRECT ("check_hash", "pieces.hash.on_completion.set");
|
||||
|
||||
CMD2_REDIRECT ("key_layout", "keys.layout.set");
|
||||
|
||||
CMD2_REDIRECT_GENERIC("to_gm_time", "convert.gm_time");
|
||||
CMD2_REDIRECT_GENERIC("to_gm_date", "convert.gm_date");
|
||||
CMD2_REDIRECT_GENERIC("to_time", "convert.time");
|
||||
CMD2_REDIRECT_GENERIC("to_date", "convert.date");
|
||||
CMD2_REDIRECT_GENERIC("to_elapsed_time", "convert.elapsed_time");
|
||||
CMD2_REDIRECT_GENERIC("to_kb", "convert.kb");
|
||||
CMD2_REDIRECT_GENERIC("to_mb", "convert.mb");
|
||||
CMD2_REDIRECT_GENERIC("to_xb", "convert.xb");
|
||||
CMD2_REDIRECT_GENERIC("to_throttle", "convert.throttle");
|
||||
|
||||
// Deprecated commands. Don't use these anymore.
|
||||
|
||||
if (rpc::call_command_value("method.use_intermediate") == 1) {
|
||||
@@ -634,7 +646,6 @@ main(int argc, char** argv) {
|
||||
CMD2_REDIRECT ("get_session_on_completion", "session.on_completion");
|
||||
CMD2_REDIRECT_GENERIC("set_session_on_completion", "session.on_completion.set");
|
||||
|
||||
CMD2_REDIRECT ("check_hash", "pieces.hash.on_completion.set");
|
||||
CMD2_REDIRECT ("get_check_hash", "pieces.hash.on_completion");
|
||||
CMD2_REDIRECT_GENERIC("set_check_hash", "pieces.hash.on_completion.set");
|
||||
|
||||
@@ -809,16 +820,6 @@ main(int argc, char** argv) {
|
||||
// Rename these to avoid conflicts with old style.
|
||||
CMD2_REDIRECT_GENERIC("d.multicall", "d.multicall2");
|
||||
|
||||
CMD2_REDIRECT_GENERIC("to_gm_time", "convert.gm_time");
|
||||
CMD2_REDIRECT_GENERIC("to_gm_date", "convert.gm_date");
|
||||
CMD2_REDIRECT_GENERIC("to_time", "convert.time");
|
||||
CMD2_REDIRECT_GENERIC("to_date", "convert.date");
|
||||
CMD2_REDIRECT_GENERIC("to_elapsed_time", "convert.elapsed_time");
|
||||
CMD2_REDIRECT_GENERIC("to_kb", "convert.kb");
|
||||
CMD2_REDIRECT_GENERIC("to_mb", "convert.mb");
|
||||
CMD2_REDIRECT_GENERIC("to_xb", "convert.xb");
|
||||
CMD2_REDIRECT_GENERIC("to_throttle", "convert.throttle");
|
||||
|
||||
CMD2_REDIRECT_GENERIC("execute_throw", "execute.throw");
|
||||
CMD2_REDIRECT_GENERIC("execute_nothrow", "execute.nothrow");
|
||||
CMD2_REDIRECT_GENERIC("execute_raw", "execute.raw");
|
||||
@@ -1002,6 +1003,7 @@ print_help() {
|
||||
std::cout << "order. Use the up/down/left/right arrow keys to move between screens." << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "Usage: rtorrent [OPTIONS]... [FILE]... [URL]..." << std::endl;
|
||||
std::cout << " -D Enable deprecated commands" << std::endl;
|
||||
std::cout << " -h Display this very helpful text" << std::endl;
|
||||
std::cout << " -n Don't try to load ~/.rtorrent.rc on startup" << std::endl;
|
||||
std::cout << " -b <a.b.c.d> Bind the listening socket to this IP" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user