Add command line options

This commit is contained in:
PixlOne
2019-08-08 22:13:50 -04:00
parent e36750f8cd
commit c2b5fceaf5
3 changed files with 101 additions and 2 deletions
+13
View File
@@ -107,4 +107,17 @@ Action string_to_action(std::string s)
if(s == "changedpi") return Action::ChangeDPI;
throw std::invalid_argument(original_str + " is an invalid action.");
}
LogLevel string_to_loglevel(std::string s)
{
std::string original_str = s;
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
if(s == "debug") return DEBUG;
if(s == "info") return INFO;
if(s == "warn" || s == "warning") return WARN;
if(s == "error") return ERROR;
throw std::invalid_argument(original_str + " is an invalid log level.");
}