This commit is contained in:
@@ -122,8 +122,11 @@ void PtouchPrint::setupCliParser() {
|
|||||||
std::cout << "ptprnt version: " << mVersionString << std::endl;
|
std::cout << "ptprnt version: " << mVersionString << std::endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// General options
|
||||||
mApp.add_flag("-v,--verbose", mVerboseFlag, "Enable verbose output");
|
mApp.add_flag("-v,--verbose", mVerboseFlag, "Enable verbose output");
|
||||||
mApp.add_flag("-V,--version", printVersion, "Prints the ptprnt's version");
|
mApp.add_flag("-V,--version", printVersion, "Prints the ptprnt's version");
|
||||||
|
|
||||||
|
// Text printing options
|
||||||
mApp.add_option("-t,--text",
|
mApp.add_option("-t,--text",
|
||||||
"Text to print (can be used multple times, use formatting options before to "
|
"Text to print (can be used multple times, use formatting options before to "
|
||||||
"influence text layout)")
|
"influence text layout)")
|
||||||
@@ -132,25 +135,28 @@ void PtouchPrint::setupCliParser() {
|
|||||||
->trigger_on_parse()
|
->trigger_on_parse()
|
||||||
->each([this](std::string text) { mCommands.emplace_back(CliCmdType::Text, text); });
|
->each([this](std::string text) { mCommands.emplace_back(CliCmdType::Text, text); });
|
||||||
mApp.add_option("-f,--font", "Font used for the following text occurences")
|
mApp.add_option("-f,--font", "Font used for the following text occurences")
|
||||||
->group("Printing")
|
->group("Text printing ")
|
||||||
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
||||||
->trigger_on_parse()
|
->trigger_on_parse()
|
||||||
->each([this](std::string font) { mCommands.emplace_back(CliCmdType::Font, font); });
|
->each([this](std::string font) { mCommands.emplace_back(CliCmdType::Font, font); });
|
||||||
mApp.add_option("-s,--fontsize", "Font size of the following text occurences")
|
mApp.add_option("-s,--fontsize", "Font size of the following text occurences")
|
||||||
->group("Printing")
|
->group("Text printing ")
|
||||||
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
||||||
->trigger_on_parse()
|
->trigger_on_parse()
|
||||||
->each([this](std::string size) { mCommands.emplace_back(CliCmdType::FontSize, size); });
|
->each([this](std::string size) { mCommands.emplace_back(CliCmdType::FontSize, size); });
|
||||||
mApp.add_option("--valign", "Vertical alignment of the following text occurences")
|
mApp.add_option("--valign", "Vertical alignment of the following text occurences")
|
||||||
->group("Printing")
|
->group("Text printing ")
|
||||||
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
||||||
->trigger_on_parse()
|
->trigger_on_parse()
|
||||||
->each([this](std::string valign) { mCommands.emplace_back(CliCmdType::VAlign, valign); });
|
->each([this](std::string valign) { mCommands.emplace_back(CliCmdType::VAlign, valign); });
|
||||||
mApp.add_option("--halign", "Vertical alignment of the following text occurences")
|
mApp.add_option("--halign", "Vertical alignment of the following text occurences")
|
||||||
->group("Printing")
|
->group("Text printing ")
|
||||||
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
->multi_option_policy(CLI::MultiOptionPolicy::TakeAll)
|
||||||
->trigger_on_parse()
|
->trigger_on_parse()
|
||||||
->each([this](std::string halign) { mCommands.emplace_back(CliCmdType::HAlign, halign); });
|
->each([this](std::string halign) { mCommands.emplace_back(CliCmdType::HAlign, halign); });
|
||||||
}
|
|
||||||
|
|
||||||
|
// Image options
|
||||||
|
mApp.add_option("-i,--image", "Image to print. Excludes all text printing ")
|
||||||
|
->group("Image printing");
|
||||||
|
}
|
||||||
} // namespace ptprnt
|
} // namespace ptprnt
|
Reference in New Issue
Block a user