mirror of
https://github.com/monero-project/monero.git
synced 2025-12-27 21:23:46 -08:00
print limits when running limit commands with no arguments
It's more user friendly that an error message saying the command does not exist.
This commit is contained in:
@@ -251,7 +251,10 @@ bool t_command_parser_executor::print_status(const std::vector<std::string>& arg
|
||||
|
||||
bool t_command_parser_executor::set_limit(const std::vector<std::string>& 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<std::string>& args)
|
||||
|
||||
bool t_command_parser_executor::set_limit_up(const std::vector<std::string>& 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<std::string>& arg
|
||||
|
||||
bool t_command_parser_executor::set_limit_down(const std::vector<std::string>& 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]);
|
||||
|
||||
Reference in New Issue
Block a user