btrfs-progs: limit minimal num of args for btrfs-image

The btrfs-image requires at least 2 args to run,
one for the source dev/file, the other for the target dev/file.

This patch depends on patch:
	btrfs-progs: move the check_argc_* functions into utils.c

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Gui Hecheng 2014-06-30 11:54:12 +08:00 committed by David Sterba
parent a184abc70f
commit 3f6c8a1610

View file

@ -2522,6 +2522,10 @@ int main(int argc, char *argv[])
} }
argc = argc - optind; argc = argc - optind;
set_argv0(argv);
if (check_argc_min(argc, 2))
print_usage();
dev_cnt = argc - 1; dev_cnt = argc - 1;
if (create) { if (create) {