summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorNagi5Yeq <wu@x-nagi.com>2020-05-27 02:42:01 +0800
committerNagi5Yeq <wu@x-nagi.com>2020-05-27 02:42:01 +0800
commitc84e212d0de5ff9f14ab14ac5143e56d2839ac82 (patch)
treef511bc44b251d5dac2a7ab87b687e8d00b3dc07c /main.cc
parentba1e3fdd1eea618a38e56918912dc966d1e399a8 (diff)
fix the rr-conflicts
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.cc b/main.cc
index 0db215b..21baac1 100644
--- a/main.cc
+++ b/main.cc
@@ -14,11 +14,11 @@
int main(int argc, char* argv[]) {
int rv;
- pcc::LogLevel level = pcc::PCC_WARNING;
+ int level = pcc::ToUnderlying(pcc::PCC_WARNING);
while ((rv = getopt(argc, argv, "vVh")) != -1) {
switch (rv) {
case 'v':
- level = pcc::PCC_DEBUG;
+ level = (level == 0 ? 0 : level - 1);
break;
case 'V':
pcc::ShowVersion();
@@ -29,6 +29,7 @@ int main(int argc, char* argv[]) {
pcc::ShowHelp();
}
}
+ pcc::SetLogLevel(static_cast<pcc::LogLevel>(level));
if (optind >= argc) {
pcc::Log(pcc::PCC_ERROR, "No input file specified");
return 0;