mirror of
https://github.com/SatDump/SatDump
synced 2026-08-13 17:47:30 -04:00
Some CLI2 cleanup
This commit is contained in:
parent
cda9d26de6
commit
e5859ef054
13 changed files with 323 additions and 201 deletions
|
|
@ -5,7 +5,21 @@
|
|||
|
||||
namespace satdump
|
||||
{
|
||||
void processProductsOrDataset(std::string product, std::string directory)
|
||||
void ProcessCmdHandler::reg(CLI::App *app)
|
||||
{
|
||||
CLI::App *sub_process = app->add_subcommand("process", "Process products/dataset automatically");
|
||||
sub_process->add_option("product", "Product to process")->required();
|
||||
sub_process->add_option("directory", "Output folder")->required();
|
||||
}
|
||||
|
||||
void ProcessCmdHandler::run(CLI::App *app, CLI::App *subcom)
|
||||
{
|
||||
std::string pro = subcom->get_option("product")->as<std::string>();
|
||||
std::string dir = subcom->get_option("directory")->as<std::string>();
|
||||
processProductsOrDataset(pro, dir);
|
||||
}
|
||||
|
||||
void ProcessCmdHandler::processProductsOrDataset(std::string product, std::string directory)
|
||||
{
|
||||
if (!std::filesystem::exists(directory))
|
||||
std::filesystem::create_directories(directory);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue