Skip to content

Commit 3f879a3

Browse files
sarroutbisergio-correia
authored andcommitted
Avoid invalid message for clevis command
When specifying 'clevis' command with no parameters, different options should be printed without message "Command 'clevis' is invalid" Fixes latchset#376 Signed-off-by: Sergio Arroutbi <[email protected]>
1 parent e0e92f8 commit 3f879a3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/clevis

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ function findexe() {
2727
}
2828

2929
cmd=clevis
30+
input_commands="$cmd $@"
31+
3032
while [ $# -gt 0 ]; do
3133
[[ "$1" =~ ^- ]] && break
3234
cmd="$cmd-$1"
@@ -36,8 +38,11 @@ while [ $# -gt 0 ]; do
3638
done
3739

3840
exec >&2
39-
echo
40-
echo "Command '$cmd' is invalid"
41+
if [ "$cmd" != "clevis" ];
42+
then
43+
echo
44+
echo "Command '$input_commands' is invalid"
45+
fi
4146
echo
4247
echo "Usage: clevis COMMAND [OPTIONS]"
4348
echo

0 commit comments

Comments
 (0)