chef / omnibus

Easily create full-stack installers for your project across a variety of platforms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Omnibus CLI returns 0 exit code on failed commands

legal90 opened this issue · comments

Description

Omnibus CLI returns 0 exit codes when non-existing command or argument was passed

Omnibus Version

v5.6.1

Platform Version

macOS 10.13.3

Replication Case

Example n.1

$ bundle exec omnibus
Commands:
  omnibus build PROJECT        # Build the given Omnibus project
  omnibus cache [COMMAND]      # Manage the cache
  omnibus changelog [COMMAND]  # Create and view changelogs
  omnibus clean PROJECT        # Clean the Omnibus project
  omnibus list                 # List the Omnibus projects
  omnibus manifest PROJECT     # Print a manifest for the given Omnibus project
  omnibus new NAME             # Initialize a new Omnibus project
  omnibus publish [COMMAND]    # Publish Omnibus packages to a backend

Options:
  -c, [--config=CONFIG]        # Path to the Omnibus config file
                               # Default: omnibus.rb
  -l, [--log-level=LOG_LEVEL]  # The log level
                               # Default: info
                               # Possible values: unknown, internal, debug, info, warn, error, fatal, nothing
  -o, [--override=key:value]   # Override one or more Omnibus config options

$ echo $?
0

Example n.2

$ bundle exec omnibus help me
Could not find command "me".

$ echo $?
0

Example n.3

$ bundle exec omnibus build with something
                    [CLI] I | 2018-02-10T21:41:12+01:00 | Using config from 'omnibus.rb'
ERROR: "omnibus build" was called with arguments ["with", "something"]
Usage: "omnibus build PROJECT"

$ echo $?
0

Having the proper exit code is very important for using omnibus in CI/CD pipelines.

I've provided the fix for it: #822