From 7eff2b83c4a0dca0d70559cfea754d5920c7415d Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 19 May 2017 10:23:46 -0300 Subject: [PATCH] Fail when an invalid algorithm is specified in --dithering-algorithm --- src/app/cli/cli_processor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/cli/cli_processor.cpp b/src/app/cli/cli_processor.cpp index 248276da3..127d9ff66 100644 --- a/src/app/cli/cli_processor.cpp +++ b/src/app/cli/cli_processor.cpp @@ -352,6 +352,10 @@ void CliProcessor::process() ditheringAlgorithm = render::DitheringAlgorithm::OldOrdered; else if (value.value() == "ordered") ditheringAlgorithm = render::DitheringAlgorithm::Ordered; + else + throw std::runtime_error("--dithering-algorithm needs a valid algorithm name\n" + "Usage: --dithering-algorithm \n" + "Where can be none, old-ordered, or ordered"); } // --color-mode else if (opt == &m_options.colorMode()) {