X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d625e80d62fc8b98c18a95c65e6fa329b7fcc85b..43fff4a2cf7da8c3a5c24633d998bf52f9cf12a2:/projects/sgconf/options.cpp diff --git a/projects/sgconf/options.cpp b/projects/sgconf/options.cpp index 06889174..a079e1b1 100644 --- a/projects/sgconf/options.cpp +++ b/projects/sgconf/options.cpp @@ -66,6 +66,15 @@ OPTION::~OPTION() delete m_action; } +OPTION & OPTION::operator=(const OPTION & rhs) +{ +m_shortName = rhs.m_shortName; +m_longName = rhs.m_longName; +m_action = rhs.m_action->Clone(); +m_description = rhs.m_description; +return *this; +} + void OPTION::Help(size_t level) const { if (!m_action) @@ -103,7 +112,10 @@ try } catch (const ACTION::ERROR & ex) { - throw ERROR(m_longName + ": " + ex.what()); + if (m_longName.empty()) + throw ERROR("-" + m_shortName + ": " + ex.what()); + else + throw ERROR("--" + m_longName + ", -" + m_shortName + ": " + ex.what()); } }