Use , separator in --shrink-to and --frame-range

This commit is contained in:
David Capello 2016-04-04 12:21:06 -03:00
parent e353a2f79d
commit 019e6b3b28
2 changed files with 8 additions and 8 deletions

View File

@ -329,7 +329,7 @@ void App::initialize(const AppOptions& options)
else if (opt == &options.frameTag()) {
frameTagName = value.value();
}
// --frame-range <range>
// --frame-range from,to
else if (opt == &options.frameRange()) {
frameRange = value.value();
}
@ -356,7 +356,7 @@ void App::initialize(const AppOptions& options)
else if (opt == &options.trim()) {
trim = true;
}
// --crop
// --crop x,y,width,height
else if (opt == &options.crop()) {
std::vector<std::string> parts;
base::split_string(value.value(), parts, ",");
@ -495,10 +495,10 @@ void App::initialize(const AppOptions& options)
ctx->executeCommand(command);
}
}
// --shrink-to <widthxheight>
// --shrink-to <width,height>
else if (opt == &options.shrinkTo()) {
std::vector<std::string> dimensions;
base::split_string(value.value(), dimensions, "x");
base::split_string(value.value(), dimensions, ",");
double maxWidth = base::convert_to<double>(dimensions.at(0));
double maxHeight = base::convert_to<double>(dimensions.at(1));
double scaleWidth, scaleHeight, scale;
@ -583,7 +583,7 @@ void App::initialize(const AppOptions& options)
}
else if (!frameRange.empty()) {
std::vector<std::string> splitRange;
base::split_string(frameRange, splitRange, ":");
base::split_string(frameRange, splitRange, ",");
frameTag = new FrameTag(base::convert_to<frame_t>(splitRange.at(0)),
base::convert_to<frame_t>(splitRange.at(1)));
}

View File

@ -30,9 +30,9 @@ AppOptions::AppOptions(int argc, const char* argv[])
, m_batch(m_po.add("batch").mnemonic('b').description("Do not start the UI"))
, m_saveAs(m_po.add("save-as").requiresValue("<filename>").description("Save the last given document with other format"))
, m_scale(m_po.add("scale").requiresValue("<factor>").description("Resize all previous opened documents"))
, m_shrinkTo(m_po.add("shrink-to").requiresValue("<widthxheight>").description("Shrink to size if the Sprite is larger than width or height"))
, m_shrinkTo(m_po.add("shrink-to").requiresValue("width,height").description("Shrink each sprite if it is\nlarger than width or height"))
, m_data(m_po.add("data").requiresValue("<filename.json>").description("File to store the sprite sheet metadata"))
, m_format(m_po.add("format").requiresValue("<format>").description("Format to export the data file (json-hash, json-array)"))
, m_format(m_po.add("format").requiresValue("<format>").description("Format to export the data file\n(json-hash, json-array)"))
, m_sheet(m_po.add("sheet").requiresValue("<filename.png>").description("Image file to save the texture"))
, m_sheetWidth(m_po.add("sheet-width").requiresValue("<pixels>").description("Sprite sheet width"))
, m_sheetHeight(m_po.add("sheet-height").requiresValue("<pixels>").description("Sprite sheet height"))
@ -42,7 +42,7 @@ AppOptions::AppOptions(int argc, const char* argv[])
, m_layer(m_po.add("layer").alias("import-layer").requiresValue("<name>").description("Include just the given layer in the sheet"))
, m_allLayers(m_po.add("all-layers").description("Make all layers visible\nBy default hidden layers will be ignored"))
, m_frameTag(m_po.add("frame-tag").requiresValue("<name>").description("Include tagged frames in the sheet"))
, m_frameRange(m_po.add("frame-range").requiresValue("<from:to>").description("Include frames from:to in the sheet"))
, m_frameRange(m_po.add("frame-range").requiresValue("from,to").description("Only export frames in the [from,to] range"))
, m_ignoreEmpty(m_po.add("ignore-empty").description("Do not export empty frames/cels"))
, m_borderPadding(m_po.add("border-padding").requiresValue("<value>").description("Add padding on the texture borders"))
, m_shapePadding(m_po.add("shape-padding").requiresValue("<value>").description("Add padding between frames"))