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:
parent
26b2f58d78
commit
c3dcb083d9
|
@ -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];
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue