Commit 307933ff authored by Joao Afonso's avatar Joao Afonso
Browse files

Enforcing uppercase VID on cta-tape-label

parent 00d72c8d
Pipeline #4837959 failed with stages
in 43 minutes and 14 seconds
......@@ -59,9 +59,12 @@ TapeLabelCmdLineArgs::TapeLabelCmdLineArgs(const int argc, char *const *const ar
exception::CommandLineNotParsed ex;
ex.getMessage() << "The -" << (char)opt << " option too big";
throw ex;
} else {
m_vid = std::string(optarg);
utils::toUpper(m_vid);
}
m_vid = std::string(optarg);
if (!utils::isUpper(m_vid)) {
exception::CommandLineNotParsed ex;
ex.getMessage() << "The -" << (char)opt << " option must only contain uppercase alphanumeric characters";
throw ex;
}
break;
case 'o':
......@@ -69,9 +72,12 @@ TapeLabelCmdLineArgs::TapeLabelCmdLineArgs(const int argc, char *const *const ar
exception::CommandLineNotParsed ex;
ex.getMessage() << "The -" << (char)opt << " option too big";
throw ex;
} else {
m_oldLabel = std::string(optarg);
utils::toUpper(m_oldLabel);
}
m_oldLabel = std::string(optarg);
if (!utils::isUpper(m_vid)) {
exception::CommandLineNotParsed ex;
ex.getMessage() << "The -" << (char)opt << " option must only contain uppercase alphanumeric characters";
throw ex;
}
break;
case 't':
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment