diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-19 13:30:06 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-01-19 13:30:06 +0100 |
commit | ecbf1339a63e99a8ef7d5ddc334e38a39f291d3d (patch) | |
tree | 0483487c6fa237ac649c4bd0414bb564a7111925 /btrfs-map-logical.c | |
parent | ca7b429f263ab19acf606846dd560be7e8519302 (diff) |
btrfs-progs: cleanup, move getop long options close to their use
Move long_option defintions just before getopt_long everywhere.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'btrfs-map-logical.c')
-rw-r--r-- | btrfs-map-logical.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index 47d1104d..a9e66bf3 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -112,15 +112,6 @@ static void print_usage(void) exit(1); } -static struct option long_options[] = { - /* { "byte-count", 1, NULL, 'b' }, */ - { "logical", 1, NULL, 'l' }, - { "copy", 1, NULL, 'c' }, - { "output", 1, NULL, 'o' }, - { "bytes", 1, NULL, 'b' }, - { NULL, 0, NULL, 0} -}; - int main(int ac, char **av) { struct cache_tree root_cache; @@ -130,13 +121,22 @@ int main(int ac, char **av) char *output_file = NULL; u64 logical = 0; int ret = 0; - int option_index = 0; u64 copy = 0; u64 bytes = 0; int out_fd = 0; while(1) { int c; + int option_index = 0; + static struct option long_options[] = { + /* { "byte-count", 1, NULL, 'b' }, */ + { "logical", 1, NULL, 'l' }, + { "copy", 1, NULL, 'c' }, + { "output", 1, NULL, 'o' }, + { "bytes", 1, NULL, 'b' }, + { NULL, 0, NULL, 0} + }; + c = getopt_long(ac, av, "l:c:o:b:", long_options, &option_index); if (c < 0) |