summaryrefslogtreecommitdiff
path: root/lib/cmdparse.rb
diff options
Diffstat (limited to 'lib/cmdparse.rb')
-rw-r--r--lib/cmdparse.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/cmdparse.rb b/lib/cmdparse.rb
index 060992f..cbe4e94 100644
--- a/lib/cmdparse.rb
+++ b/lib/cmdparse.rb
@@ -47,7 +47,7 @@ end
module CmdParse
# The version of this cmdparse implemention
- VERSION = '3.0.6'.freeze
+ VERSION = '3.0.7'.freeze
# Base class for all cmdparse errors.
@@ -898,6 +898,10 @@ module CmdParse
@main_command.commands['help'].execute(*@current_command.command_chain.map(&:name))
end
exit(64) # FreeBSD standard exit error for "command was used incorrectly"
+ rescue Interrupt
+ exit(128 + 2)
+ rescue Errno::EPIPE
+ # Behave well when used in a pipe
ensure
@current_command = nil
end