mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 11:23:26 +01:00
daemon: add a version command
This commit is contained in:
parent
1f96755ddc
commit
35d1269fac
@ -27,6 +27,7 @@
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "common/dns_utils.h"
|
||||
#include "version.h"
|
||||
#include "daemon/command_parser_executor.h"
|
||||
|
||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||
@ -664,4 +665,10 @@ bool t_command_parser_executor::sync_info(const std::vector<std::string>& args)
|
||||
return m_executor.sync_info();
|
||||
}
|
||||
|
||||
bool t_command_parser_executor::version(const std::vector<std::string>& args)
|
||||
{
|
||||
std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace daemonize
|
||||
|
@ -138,6 +138,8 @@ public:
|
||||
bool relay_tx(const std::vector<std::string>& args);
|
||||
|
||||
bool sync_info(const std::vector<std::string>& args);
|
||||
|
||||
bool version(const std::vector<std::string>& args);
|
||||
};
|
||||
|
||||
} // namespace daemonize
|
||||
|
@ -280,6 +280,11 @@ t_command_server::t_command_server(
|
||||
, std::bind(&t_command_parser_executor::sync_info, &m_parser, p::_1)
|
||||
, "Print information about the blockchain sync state."
|
||||
);
|
||||
m_command_lookup.set_handler(
|
||||
"version"
|
||||
, std::bind(&t_command_parser_executor::version, &m_parser, p::_1)
|
||||
, "Print version information."
|
||||
);
|
||||
}
|
||||
|
||||
bool t_command_server::process_command_str(const std::string& cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user