HomePhorge

(PUP-2622) Use non-zero exit codes for unknown subcommands.
da4cef916fa7Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2622) Use non-zero exit codes for unknown subcommands.

Previously, if users execute 'puppet foo', an error message is displayed
about unknown subcommand 'foo', but puppet still exits with a zero exit
code indicating success.

Additionally, if users execute 'puppet --option <valid_subcommand>',
puppet silently ignores the option, prints a message, and exits with a
zero exit code. As a result, a user accidentally transposed a valid
option for a subcommand with the subcommand itself in an automated context
and puppet did not report a failure.

This commit fixes both conditions by exiting with 1 from the nil and unknown
subcommands where appropriate. It also prints error messages using the same
colorized output we use for usual puppet errors.

Details

Provenance
Peter Huene <peter.huene@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUd1723f8c38a4: Merge branch 'stable'
Branches
Unknown
Tags
Unknown

Event Timeline

Peter Huene <peter.huene@puppetlabs.com> committed rPUda4cef916fa7: (PUP-2622) Use non-zero exit codes for unknown subcommands. (authored by Peter Huene <peter.huene@puppetlabs.com>).Jun 3 2014, 6:33 PM