From ecbf1339a63e99a8ef7d5ddc334e38a39f291d3d Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 19 Jan 2015 13:30:06 +0100 Subject: 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 --- cmds-subvolume.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'cmds-subvolume.c') diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 3895d116..97293fd6 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -219,15 +219,15 @@ static int cmd_subvol_delete(int argc, char **argv) DIR *dirstream = NULL; int verbose = 0; int commit_mode = 0; - struct option long_options[] = { - {"commit-after", no_argument, NULL, 'c'}, /* commit mode 1 */ - {"commit-each", no_argument, NULL, 'C'}, /* commit mode 2 */ - {NULL, 0, NULL, 0} - }; optind = 1; while (1) { int c; + struct option long_options[] = { + {"commit-after", no_argument, NULL, 'c'}, /* commit mode 1 */ + {"commit-each", no_argument, NULL, 'C'}, /* commit mode 2 */ + {NULL, 0, NULL, 0} + }; c = getopt_long(argc, argv, "cC", long_options, NULL); if (c < 0) @@ -391,15 +391,10 @@ static int cmd_subvol_list(int argc, char **argv) int fd = -1; u64 top_id; int ret = -1, uerr = 0; - int c; char *subvol; int is_tab_result = 0; int is_list_all = 0; int is_only_in_path = 0; - struct option long_options[] = { - {"sort", 1, NULL, 'S'}, - {NULL, 0, NULL, 0} - }; DIR *dirstream = NULL; filter_set = btrfs_list_alloc_filter_set(); @@ -407,6 +402,12 @@ static int cmd_subvol_list(int argc, char **argv) optind = 1; while(1) { + int c; + struct option long_options[] = { + {"sort", 1, NULL, 'S'}, + {NULL, 0, NULL, 0} + }; + c = getopt_long(argc, argv, "acdgopqsurRG:C:t", long_options, NULL); if (c < 0) -- cgit v1.2.3