From 958bd97a55eed38c295687c2e85f9fb135f89eb3 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Thu, 19 Jun 2014 09:27:08 +0800 Subject: btrfs-progs: restore: don't allow users to specify -r and -f at the same time These two options are used for same purpose, but they are exclusive with each other. Make it clear to common users. Signed-off-by: Wang Shilong Signed-off-by: David Sterba --- cmds-restore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmds-restore.c b/cmds-restore.c index afcb3473..310a84e1 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1218,6 +1218,11 @@ int cmd_restore(int argc, char **argv) else if (list_roots && optind >= argc) usage(cmd_restore_usage); + if (fs_location && root_objectid) { + fprintf(stderr, "don't use -f and -r at the same time.\n"); + return 1; + } + if ((ret = check_mounted(argv[optind])) < 0) { fprintf(stderr, "Could not check mount status: %s\n", strerror(-ret)); -- cgit v1.2.3