Commit ed7586a7 authored by Pavel Emelyanov's avatar Pavel Emelyanov

crtools: Rewrite options parsing via while

This avoids two duplicate lines.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 90ae972b
...@@ -334,8 +334,11 @@ int main(int argc, char *argv[]) ...@@ -334,8 +334,11 @@ int main(int argc, char *argv[])
/* Default options */ /* Default options */
opts.final_state = TASK_DEAD; opts.final_state = TASK_DEAD;
for (opt = getopt_long(argc - 1, argv + 1, short_opts, NULL, &idx); opt != -1; while (1) {
opt = getopt_long(argc - 1, argv + 1, short_opts, NULL, &idx)) { opt = getopt_long(argc - 1, argv + 1, short_opts, NULL, &idx);
if (opt == -1)
break;
switch (opt) { switch (opt) {
case 's': case 's':
opts.final_state = TASK_STOPPED; opts.final_state = TASK_STOPPED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment