Skip to content

Commit 20c7f39

Browse files
committed
Merge branch 'issue-22' into release-2.0. Hotfix for #22.
2 parents d5aefff + 20c8d05 commit 20c7f39

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

include/command_line/command_line_config.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ class CommandLineConfig {
8989
exit(0);
9090
}
9191

92+
if (write_config.value() != "") {
93+
std::ofstream ofs(write_config.value());
94+
if (!ofs.is_open()) {
95+
std::cerr << "Unable to write config file!" << std::endl;
96+
exit(1);
97+
}
98+
write_config_file(ofs, argv[0]);
99+
exit(0);
100+
}
101+
92102
auto missing_arg = false;
93103
for (auto it = Args::arg_begin(); it != Args::arg_end(); ++it) {
94104
auto arg = *it;
@@ -104,16 +114,6 @@ class CommandLineConfig {
104114
if (missing_arg) {
105115
exit(1);
106116
}
107-
108-
if (write_config.value() != "") {
109-
std::ofstream ofs(write_config.value());
110-
if (!ofs.is_open()) {
111-
std::cerr << "Unable to write config file!" << std::endl;
112-
exit(1);
113-
}
114-
write_config_file(ofs, argv[0]);
115-
exit(0);
116-
}
117117
}
118118

119119
private:

0 commit comments

Comments
 (0)