Browse Source

[fix] do not spit out error messages for utils/lxc.sh --help

Error::

  $ utils/lxc.sh --help
  ERROR: missing command lxc
  ...

This breaks also docs build::

  $ make docs
  ...
  WARNING: Unexpected return code 42 from command '../utils/lxc.sh --help'
  ...

Signed-off-by: Markus Heiser <markus@darmarit.de>
Markus Heiser 4 years ago
parent
commit
438d35c386
1 changed files with 2 additions and 2 deletions
  1. 2 2
      utils/lxc.sh

+ 2 - 2
utils/lxc.sh

@@ -142,11 +142,11 @@ main() {
     local _usage="unknown or missing $1 command $2"
 
     # don't check prerequisite when in recursion
-    if [[ ! $1 == __* ]]; then
+    if [[ ! $1 == __* ]] && [[ ! $1 == --help  ]]; then
         if ! in_container; then
             ! required_commands lxc && lxd_info && exit 42
         fi
-        [[ -z $LXC_SUITE ]] && err_msg "missing LXC_SUITE" && exit 42 
+        [[ -z $LXC_SUITE ]] && err_msg "missing LXC_SUITE" && exit 42
     fi
 
     case $1 in