diff options
author | David Robillard <d@drobilla.net> | 2020-12-31 12:37:57 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-31 12:37:57 +0100 |
commit | 8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376 (patch) | |
tree | c65c3327fde67505a8f989e57cb245ee0f286cb9 /src/serdi.c | |
parent | 19d8a055ff1e58a699e3679b701a1a60a2927243 (diff) | |
download | serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.tar.gz serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.tar.bz2 serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.zip |
Avoid "else" after "break" and "return"
Diffstat (limited to 'src/serdi.c')
-rw-r--r-- | src/serdi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/serdi.c b/src/serdi.c index 189692dd..69304cad 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -205,7 +205,9 @@ main(int argc, char** argv) in_name = (const uint8_t*)"(stdin)"; in_fd = stdin; break; - } else if (argv[a][1] == 'a') { + } + + if (argv[a][1] == 'a') { ascii = true; } else if (argv[a][1] == 'b') { bulk_write = true; @@ -229,29 +231,36 @@ main(int argc, char** argv) } else if (argv[a][1] == 'i') { if (++a == argc) { return missing_arg(argv[0], 'i'); - } else if (!(input_syntax = get_syntax(argv[a]))) { + } + + if (!(input_syntax = get_syntax(argv[a]))) { return print_usage(argv[0], true); } } else if (argv[a][1] == 'o') { if (++a == argc) { return missing_arg(argv[0], 'o'); - } else if (!(output_syntax = get_syntax(argv[a]))) { + } + + if (!(output_syntax = get_syntax(argv[a]))) { return print_usage(argv[0], true); } } else if (argv[a][1] == 'p') { if (++a == argc) { return missing_arg(argv[0], 'p'); } + add_prefix = (const uint8_t*)argv[a]; } else if (argv[a][1] == 'c') { if (++a == argc) { return missing_arg(argv[0], 'c'); } + chop_prefix = (const uint8_t*)argv[a]; } else if (argv[a][1] == 'r') { if (++a == argc) { return missing_arg(argv[0], 'r'); } + root_uri = (const uint8_t*)argv[a]; } else { SERDI_ERRORF("invalid option -- '%s'\n", argv[a] + 1); |