add restart other command to change partition #1657

This commit is contained in:
MichaelDvP
2024-03-13 16:03:28 +01:00
parent e00c30cd4f
commit 8dfc84eac2
5 changed files with 44 additions and 10 deletions

View File

@@ -198,9 +198,17 @@ static void setup_commands(std::shared_ptr<Commands> & commands) {
});
});
commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, string_vector{F_(restart)}, [](Shell & shell, const std::vector<std::string> & arguments) {
to_app(shell).system_.system_restart();
});
commands->add_command(ShellContext::MAIN,
CommandFlags::ADMIN,
string_vector{F_(restart)},
string_vector{F_(other_optional)},
[](Shell & shell, const std::vector<std::string> & arguments) {
if (arguments.size()) {
to_app(shell).system_.system_restart(arguments.front() == "other");
} else {
to_app(shell).system_.system_restart();
}
});
commands->add_command(ShellContext::MAIN,
CommandFlags::ADMIN,