btrfs-progs: use usage() to replace the warning msg on no-arg usage

To be consistent with the other cmds, replace the warning msg
with usage() when send/receive are used without any args.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Gui Hecheng 2014-02-13 11:16:35 +08:00 committed by Chris Mason
parent 26b2f58d78
commit c3dcb083d9
2 changed files with 4 additions and 9 deletions

View File

@ -951,10 +951,8 @@ int cmd_receive(int argc, char **argv)
}
}
if (optind + 1 != argc) {
fprintf(stderr, "ERROR: receive needs path to subvolume\n");
return 1;
}
if (check_argc_exact(argc - optind, 1))
usage(cmd_receive_usage);
tomnt = argv[optind];

View File

@ -524,11 +524,8 @@ int cmd_send(int argc, char **argv)
}
}
if (optind == argc) {
fprintf(stderr, "ERROR: send needs path to snapshot\n");
ret = 1;
goto out;
}
if (optind == argc)
usage(cmd_send_usage);
if (outname != NULL) {
send.dump_fd = creat(outname, 0600);