When no component ID is specified, no error message is printed
when the command of component deletion fails. The failure thus
could be easily ignored. And the failure reason is hard to be
understood without any error message.
Test-Parameters: trivial
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: Id20b55a3e12a7152198ee475e55f6dd764a55219
Reviewed-on: https://review.whamcloud.com/45833
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
int rc = 0;
- if (flags && neg_flags)
+ if (flags && neg_flags) {
+ fprintf(stderr,
+ "%s: cannot specify both positive and negative flags\n",
+ progname);
return -EINVAL;
+ }
if (!flags && neg_flags)
flags = neg_flags | LCME_FL_NEG;
- if ((flags && comp_id) || (!flags && !comp_id))
+ if (flags && comp_id) {
+ fprintf(stderr,
+ "%s: cannot specify component ID and flags at the same time\n",
+ progname);
return -EINVAL;
+ }
+
+ if (!flags && !comp_id) {
+ fprintf(stderr,
+ "%s: neither flags nor component ID is specified\n",
+ progname);
+ return -EINVAL;
+ }
if (flags) {
if (flags & ~LCME_KNOWN_FLAGS) {