1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

Use callhandlers() instead of manual loop in commandline.cpp. NFCI.

This commit is contained in:
Arthur O'Dwyer 2020-04-11 15:21:18 -04:00
parent 0d42168139
commit 83f5412916

View File

@ -357,12 +357,13 @@ namespace arg {
curphase = phase; curphase = phase;
callhooks(hooks_config); callhooks(hooks_config);
while(pos < isize(argument)) { while(pos < isize(argument)) {
for(auto& h: *hooks_args) { int r = callhandlers(1, hooks_args);
int r = h.second(); if(r == 2) return; if(r == 0) { lshift(); goto cont; } 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: ;
} }
} }
} }