« Previous | Next » 

Revision d971402f

Parent b0dcdc10
Child 3d8ae327

Added by Michael Hanselmann over 11 years ago

cli: Exit with status 0 for --help

This patch is somewhat longer than was anticipated. Before, commands like
“gnt-instance --help” would exit with the status code 1 (failure). With
this patch, those commands exits with 0 (success) while unknown commands
still print the usage screen and exit with status 1.

To achieve this goal without too much ugly code some refactoring on
cli._ParseArgs was necessary. Printing the version and usage screen was
separated. At the same time this allows for some unit testing.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences