mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
Use callhandlers() instead of manual loop in commandline.cpp. NFCI.
This commit is contained in:
parent
0d42168139
commit
83f5412916
@ -357,12 +357,13 @@ namespace arg {
|
||||
curphase = phase;
|
||||
callhooks(hooks_config);
|
||||
while(pos < isize(argument)) {
|
||||
for(auto& h: *hooks_args) {
|
||||
int r = h.second(); if(r == 2) return; if(r == 0) { lshift(); goto cont; }
|
||||
int r = callhandlers(1, hooks_args);
|
||||
switch (r) {
|
||||
case 0: lshift(); break;
|
||||
case 1: printf("Unknown option: %s\n", argcs()); exit(3); break;
|
||||
case 2: return;
|
||||
default: assert(false);
|
||||
}
|
||||
printf("Unknown option: %s\n", argcs());
|
||||
exit(3);
|
||||
cont: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user