diff options
Diffstat (limited to 'common/trace_option.cpp')
-rw-r--r-- | common/trace_option.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/trace_option.cpp b/common/trace_option.cpp index 5c4563fe..feae1496 100644 --- a/common/trace_option.cpp +++ b/common/trace_option.cpp @@ -28,6 +28,7 @@ #include <string.h> #include <iostream> +#include <stdlib.h> namespace trace { @@ -50,4 +51,12 @@ boolOption(const char *option, bool default_) { return default_; } +int +intOption(const char *option, int default_) { + if (!option) { + return default_; + } + return atoi(option); +} + } /* namespace trace */ |