From fce5a610fbc1a40def72d3c1f7c645b1a0dbf26d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 15 Dec 2017 13:30:11 -0500 Subject: [PATCH] Help the user figure out the problem when using -d to delete --- xCAT-server/lib/xcat/plugins/openbmc.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 3977f16f6..6d3d51b2c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1187,7 +1187,12 @@ sub parse_args { if ($updateid_passed) { # Updateid was passed, check flags allowed with update id if ($option_flag !~ /^--delete$|^-a$|^--activate$/) { - return ([ 1, "Invalid option specified when an update id is provided: $option_flag" ]); + my $optional_help_msg = ""; + if ($option_flag == "-d") { + # For this special case, -d was changed to pass in a directory. + $optional_help_msg = "Did you mean --delete?" + } + return ([ 1, "Invalid option specified when an update id is provided: $option_flag. $optional_help_msg" ]); } my $action = "activate"; if ($option_flag =~ /^--delete$/) {