From 019e6b3b289a1bfd13794e156b32205e20a7c9d7 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 4 Apr 2016 12:21:06 -0300 Subject: [PATCH] Use , separator in --shrink-to and --frame-range --- src/app/app.cpp | 10 +++++----- src/app/app_options.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/app.cpp b/src/app/app.cpp index 279576bf5..d175ba172 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -329,7 +329,7 @@ void App::initialize(const AppOptions& options) else if (opt == &options.frameTag()) { frameTagName = value.value(); } - // --frame-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 parts; base::split_string(value.value(), parts, ","); @@ -495,10 +495,10 @@ void App::initialize(const AppOptions& options) ctx->executeCommand(command); } } - // --shrink-to + // --shrink-to else if (opt == &options.shrinkTo()) { std::vector dimensions; - base::split_string(value.value(), dimensions, "x"); + base::split_string(value.value(), dimensions, ","); double maxWidth = base::convert_to(dimensions.at(0)); double maxHeight = base::convert_to(dimensions.at(1)); double scaleWidth, scaleHeight, scale; @@ -583,7 +583,7 @@ void App::initialize(const AppOptions& options) } else if (!frameRange.empty()) { std::vector splitRange; - base::split_string(frameRange, splitRange, ":"); + base::split_string(frameRange, splitRange, ","); frameTag = new FrameTag(base::convert_to(splitRange.at(0)), base::convert_to(splitRange.at(1))); } diff --git a/src/app/app_options.cpp b/src/app/app_options.cpp index cd5f1a0bf..4dfc8b495 100644 --- a/src/app/app_options.cpp +++ b/src/app/app_options.cpp @@ -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("").description("Save the last given document with other format")) , m_scale(m_po.add("scale").requiresValue("").description("Resize all previous opened documents")) - , m_shrinkTo(m_po.add("shrink-to").requiresValue("").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("").description("File to store the sprite sheet metadata")) - , m_format(m_po.add("format").requiresValue("").description("Format to export the data file (json-hash, json-array)")) + , m_format(m_po.add("format").requiresValue("").description("Format to export the data file\n(json-hash, json-array)")) , m_sheet(m_po.add("sheet").requiresValue("").description("Image file to save the texture")) , m_sheetWidth(m_po.add("sheet-width").requiresValue("").description("Sprite sheet width")) , m_sheetHeight(m_po.add("sheet-height").requiresValue("").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("").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("").description("Include tagged frames in the sheet")) - , m_frameRange(m_po.add("frame-range").requiresValue("").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("").description("Add padding on the texture borders")) , m_shapePadding(m_po.add("shape-padding").requiresValue("").description("Add padding between frames"))