diff options
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) |