satdump/src-cli/legacy.cpp

26 lines
693 B
C++
Raw Permalink Normal View History

2025-12-09 20:52:50 +01:00
#include "legacy.h"
#include "logger.h"
int main_old(int argc, char *argv[]);
namespace satdump
{
void LegacyCmdHandler::reg(CLI::App *app)
{
CLI::App *sub = app->add_subcommand("legacy", "Run legacy command from pre-2.0.0-style satdump CLI");
2025-12-09 21:10:32 +01:00
sub->prefix_command();
sub->set_help_flag();
2025-12-09 20:52:50 +01:00
}
void LegacyCmdHandler::run(CLI::App *app, CLI::App *subcom, bool is_gui)
{
2025-12-09 21:10:32 +01:00
auto args = subcom->remaining();
2025-12-09 20:52:50 +01:00
std::vector<char *> vec;
2025-12-09 21:10:32 +01:00
args.insert(args.begin(), "satdump legacy");
2025-12-09 20:52:50 +01:00
for (auto &a : args)
vec.push_back((char *)a.c_str());
exit(main_old(vec.size(), vec.data()));
}
} // namespace satdump