Before:
```
pdns_server --launch=random --socket-dir=. foo
Fatal: non-option on the command line, perhaps a '--setting=123' statement missed the '='?
```
After:
```
pdns_server --launch=random --socket-dir=. bar
Sep 10 17:24:25 Unable to open /usr/local/etc/pdns.conf
Fatal: non-options (bar) on the command line, perhaps a '--setting=123' statement missed the '='?
pdns_server --launch=random --socket-dir=. bar foo
Sep 10 17:24:25 Unable to open /usr/local/etc/pdns.conf
Fatal: non-options (bar, foo) on the command line, perhaps a '--setting=123' statement missed the '='?
```
cleanSlashes(configname);
if(!::arg().getCommands().empty()) {
- cerr<<"Fatal: non-option on the command line, perhaps a '--setting=123' statement missed the '='?"<<endl;
+ cerr<<"Fatal: non-option";
+ if (::arg().getCommands().size() > 1) {
+ cerr<<"s";
+ }
+ cerr<<" (";
+ bool first = true;
+ for (auto const c : ::arg().getCommands()) {
+ if (!first) {
+ cerr<<", ";
+ }
+ first = false;
+ cerr<<c;
+ }
+ cerr<<") on the command line, perhaps a '--setting=123' statement missed the '='?"<<endl;
exit(99);
}
BackendMakers().launch(::arg()["launch"]); // vrooooom!
if(!::arg().getCommands().empty()) {
- cerr<<"Fatal: non-option on the command line, perhaps a '--setting=123' statement missed the '='?"<<endl;
+ cerr<<"Fatal: non-option";
+ if (::arg().getCommands().size() > 1) {
+ cerr<<"s";
+ }
+ cerr<<" (";
+ bool first = true;
+ for (auto const c : ::arg().getCommands()) {
+ if (!first) {
+ cerr<<", ";
+ }
+ first = false;
+ cerr<<c;
+ }
+ cerr<<") on the command line, perhaps a '--setting=123' statement missed the '='?"<<endl;
exit(99);
}