diff options
| author | Jan Sucan <jan@jansucan.com> | 2021-05-23 14:54:06 +0200 |
|---|---|---|
| committer | Jan Sucan <jan@jansucan.com> | 2021-05-23 14:54:06 +0200 |
| commit | b2d000e697fc56c8c408432ed74a21f21d3e2423 (patch) | |
| tree | 7222a74381b822f5cee07dc0cc68e7b094d4b15c | |
| parent | 8671a99c0e856a24271e8891e540fe1422216a00 (diff) | |
src: Sort the program options alphabetically
| -rw-r--r-- | src/options.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/options.c b/src/options.c index 2017ba5..019136b 100644 --- a/src/options.c +++ b/src/options.c @@ -22,12 +22,8 @@ options_parse(int argc, char **argv, options_t *const opts) char *arg_sector_size = NULL; char *arg_buffer_size = NULL; - while ((ch = getopt(argc, argv, ":s:b:h")) != -1) { + while ((ch = getopt(argc, argv, ":b:hs:")) != -1) { switch (ch) { - case 's': - arg_sector_size = optarg; - break; - case 'b': arg_buffer_size = optarg; break; @@ -36,6 +32,10 @@ options_parse(int argc, char **argv, options_t *const opts) opts->help = true; break; + case 's': + arg_sector_size = optarg; + break; + case ':': print_error("missing argument for option '-%c'", optopt); return 1; |
