Skip to content

Commit 6d7e4ef

Browse files
committed
verbose option only used inside option parsing
It doesn't have to be a member variable.
1 parent 6db1cf9 commit 6d7e4ef

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/options.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void short_usage(char *arg0)
8585
"\t{} -h|--help\n"_format(program_name(arg0))};
8686
}
8787

88-
void long_usage(char const *arg0, bool verbose = false)
88+
void long_usage(char const *arg0, bool verbose)
8989
{
9090
char const *const name = program_name(arg0);
9191

@@ -322,6 +322,8 @@ static osmium::Box parse_bbox(char const *bbox)
322322

323323
options_t::options_t(int argc, char *argv[]) : options_t()
324324
{
325+
bool help_verbose = false; // Will be set when -v/--verbose is set
326+
325327
int c;
326328

327329
//keep going while there are args left to handle
@@ -344,7 +346,7 @@ options_t::options_t(int argc, char *argv[]) : options_t()
344346
create = true;
345347
break;
346348
case 'v':
347-
verbose = true;
349+
help_verbose = true;
348350
break;
349351
case 's':
350352
slim = true;
@@ -550,7 +552,7 @@ options_t::options_t(int argc, char *argv[]) : options_t()
550552

551553
//they were looking for usage info
552554
if (long_usage_bool) {
553-
long_usage(argv[0], verbose);
555+
long_usage(argv[0], help_verbose);
554556
return;
555557
}
556558

src/options.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ class options_t
124124
std::string input_reader{"auto"};
125125
osmium::Box bbox;
126126
bool extra_attributes = false;
127-
bool verbose = false;
128127

129128
std::vector<std::string> input_files;
130129

0 commit comments

Comments
 (0)