lib/inch/cli/command/base.rb in inch-0.6.4 vs lib/inch/cli/command/base.rb in inch-0.7.0
- old
+ new
@@ -34,10 +34,12 @@
#
# @abstract Subclass and override #run to implement a new command
# @note This was adapted from YARD
# https://github.com/lsegal/yard/blob/master/lib/yard/cli/command.rb
class Base
+ EXIT_STATUS_SUCCESS = 0
+
include TraceHelper
attr_reader :codebase # @return [Codebase::Proxy]
# Helper method to run an instance with the given +args+
@@ -68,9 +70,17 @@
# Returns a description of the command
#
# @return [String]
def description
''
+ end
+
+ # Returns the exit status of the running command.
+ # This can be overridden to customize exit statusses.
+ #
+ # @return [Fixnum] zero (by default)
+ def exit_status
+ EXIT_STATUS_SUCCESS
end
# Returns the name of the command by which it is referenced
# in the command list
#