Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-27255

(8.0.z) jboss-eap-installation-manager.bat doesn't return correct exit code

XMLWordPrintable

      I've tried running following commands on windows using cygwin terminal:

      $ cmd /c "exit 127"; echo $?
      
      127 
      $ cmd /c "C:/j/workspace-ogerzica/eap-installation-manager/jboss-eap-installation-manager-8.0/bin/jboss-eap-installation-manager.bat bad params"; echo $?
      
      Unknown command `jboss-eap-installation-manager bad params`
      Usage: jboss-eap-installation-manager [-hv] [COMMAND]
      Options:
         -h, --help           Displays the help information for the command.
         -v, --version        Prints the version of jboss-eap-installation-manager and exits.
             -vv, --verbose   Prints additional information if the command fails.
      Commands:
         install           Installs a new instance of the application server.
         update            Updates a server instance with the latest patches.
         print-licenses    Prints licenses and additional agreements required to install the server.
         history           Lists all the previous installation states.
         revert            Reverts the server to a previous installation state.
         channel           Manages the channels used by the server to get the latest updates.
         completion        Generates a bash completion script. To enable auto-completion use the command `source <(jboss-eap-installation-manager completion)`.
         clone             Exports installation details required to recreate a server.
         feature-pack, fp  Manages the feature packs installed in the server.
      Exit codes:
         0   Successful program execution.
         1   Failed operation.
         2   Invalid input arguments.
      Use `jboss-eap-installation-manager <COMMAND> --help` to show help information for the command.
      0
      

      You can see that installation-manager.bat returns 0 even tough it should return 2.

      Maybe adding something like "exit /b %ERRORLEVEL%" at the end of the .bat script would do the trick

              spyrkob Bartosz Spyrko-Smietanko
              ogerzica@redhat.com Ondrej Gerzicak
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: