Btrfs-progs: btrfs: remove dead code in handle_options

Just cleanup: remove useless return type, while loop and dead code.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Rakesh Pandit 2014-03-20 11:43:35 +02:00 committed by David Sterba
parent 1c1c7caf55
commit f84db1ca70
1 changed files with 11 additions and 22 deletions

33
btrfs.c
View File

@ -212,31 +212,20 @@ static int cmd_version(int argc, char **argv)
return 0;
}
static int handle_options(int *argc, char ***argv)
static void handle_options(int *argc, char ***argv)
{
char **orig_argv = *argv;
while (*argc > 0) {
if (*argc > 0) {
const char *arg = (*argv)[0];
if (arg[0] != '-')
break;
if (!strcmp(arg, "--help")) {
break;
} else if (!strcmp(arg, "--version")) {
break;
} else {
fprintf(stderr, "Unknown option: %s\n", arg);
fprintf(stderr, "usage: %s\n",
btrfs_cmd_group.usagestr[0]);
exit(129);
}
(*argv)++;
(*argc)--;
if (arg[0] != '-' ||
!strcmp(arg, "--help") ||
!strcmp(arg, "--version"))
return;
fprintf(stderr, "Unknown option: %s\n", arg);
fprintf(stderr, "usage: %s\n",
btrfs_cmd_group.usagestr[0]);
exit(129);
}
return (*argv) - orig_argv;
return;
}
static const struct cmd_group btrfs_cmd_group = {