diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2014-06-19 09:27:08 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-08-22 14:43:10 +0200 |
commit | 958bd97a55eed38c295687c2e85f9fb135f89eb3 (patch) | |
tree | 118f76c4f0c3c2af4fbef6ba53b4fb06e3fcd857 /cmds-restore.c | |
parent | 4cb5168ba61d87b9a9dea371c222880f68b5d6db (diff) | |
download | btrfs-progs-958bd97a55eed38c295687c2e85f9fb135f89eb3.tar.gz |
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 <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-restore.c')
-rw-r--r-- | cmds-restore.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds-restore.c b/cmds-restore.c index afcb347..310a84e 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)); |