Skip to content
Snippets Groups Projects
Commit d3866475 authored by Steven Murray's avatar Steven Murray
Browse files

AcsCmdLine::handleUnknownOption() now throws UnknownOption instead of InvalidAgument

parent 0992d116
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@
*/
#include "AcsCmdLine.hpp"
#include "common/exception/InvalidArgument.hpp"
#include "common/exception/MissingOperand.hpp"
#include <stdlib.h>
......@@ -170,7 +169,7 @@ void cta::mediachanger::acs::AcsCmdLine::handleMissingParameter(const int opt) {
// handleUnknownOption
//------------------------------------------------------------------------------
void cta::mediachanger::acs::AcsCmdLine::handleUnknownOption(const int opt) {
cta::exception::InvalidArgument ex;
UnknownOption ex;
if(0 == optopt) {
ex.getMessage() << "Unknown command-line option";
} else {
......
......@@ -96,10 +96,19 @@ protected:
*/
void handleMissingParameter(const int opt);
/**
* Unkown option.
*/
struct UnknownOption: public exception::Exception {
UnknownOption(const std::string &context = "", const bool embedBacktrace = true):
cta::exception::Exception(context, embedBacktrace) {}
};
/**
* Handles the specified unknown option.
*
* @param opt The option.
* @throw UnknownOption indepedent of the value of opt.
*/
void handleUnknownOption(const int opt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment