This commit is contained in:
45
source/src/commands/version.cpp
Normal file
45
source/src/commands/version.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
#include "command_registry.hpp"
|
||||
#include "version.hpp"
|
||||
namespace dropshell {
|
||||
|
||||
int version_handler(const CommandContext &ctx);
|
||||
|
||||
static std::vector<std::string> version_name_list = {"version","v","ver","-v","-ver","--version"};
|
||||
|
||||
void version_autocomplete(const CommandContext &ctx)
|
||||
{
|
||||
}
|
||||
|
||||
// Static registration
|
||||
struct VersionCommandRegister
|
||||
{
|
||||
VersionCommandRegister()
|
||||
{
|
||||
CommandRegistry::instance().register_command({version_name_list,
|
||||
version_handler,
|
||||
version_autocomplete,
|
||||
false, // hidden
|
||||
false, // requires_config
|
||||
false, // requires_install
|
||||
0, // min_args (after command)
|
||||
0, // max_args (after command)
|
||||
"version",
|
||||
"Uninstall a service on a server. Does not remove configuration or user data.",
|
||||
// heredoc
|
||||
R"(
|
||||
Uninstall a service on a server. Does not remove configuration or user data.
|
||||
uninstall <server> <service> uninstall the given service on the given server.
|
||||
uninstall <server> uninstall all services on the given server.
|
||||
)"});
|
||||
}
|
||||
} version_command_register;
|
||||
|
||||
|
||||
int version_handler(const CommandContext &ctx)
|
||||
{
|
||||
std::cout << VERSION << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace dropshell
|
Reference in New Issue
Block a user