From d8ee0a95c7e3a1aba2aa79173f2d55f2db6f31cd Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 17 May 2015 13:13:02 +0100 Subject: print limits when running limit commands with no arguments It's more user friendly that an error message saying the command does not exist. --- src/daemon/command_parser_executor.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/daemon/command_parser_executor.cpp') diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index fd7b40be2..1b86ff269 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -251,7 +251,10 @@ bool t_command_parser_executor::print_status(const std::vector& arg bool t_command_parser_executor::set_limit(const std::vector& args) { - if(args.size()!=1) return false; + if(args.size()>1) return false; + if(args.size()==0) { + return m_executor.get_limit(); + } int limit; try { limit = std::stoi(args[0]); @@ -267,7 +270,10 @@ bool t_command_parser_executor::set_limit(const std::vector& args) bool t_command_parser_executor::set_limit_up(const std::vector& args) { - if(args.size()!=1) return false; + if(args.size()>1) return false; + if(args.size()==0) { + return m_executor.get_limit_up(); + } int limit; try { limit = std::stoi(args[0]); @@ -283,7 +289,10 @@ bool t_command_parser_executor::set_limit_up(const std::vector& arg bool t_command_parser_executor::set_limit_down(const std::vector& args) { - if(args.size()!=1) return false; + if(args.size()>1) return false; + if(args.size()==0) { + return m_executor.get_limit_down(); + } int limit; try { limit = std::stoi(args[0]); -- cgit v1.2.3