Skip to content

Commit

Permalink
Add mutant version to --help output
Browse files Browse the repository at this point in the history
[Fix mbj#1233]

* This reduces one cycle on customer support. Where people post an
  argument error parsing issue.
  • Loading branch information
mbj committed Aug 30, 2021
1 parent 58032ef commit 102c657
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v0.10.33 unreleased
# v0.10.34 2021-08-30

* [#1252](https://github.com/mbj/mutant/pull/1252)
Remove not universally useful binary left negation operator.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
mutant (0.10.33)
mutant (0.10.34)
diff-lcs (~> 1.3)
parser (~> 3.0.0)
regexp_parser (~> 2.0, >= 2.0.3)
Expand Down
2 changes: 2 additions & 0 deletions lib/mutant/cli/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def add_summary(parser)
end

def add_global_options(parser)
parser.separator("mutant version: #{VERSION}")
parser.separator(nil)
parser.separator('Global Options:')
parser.separator(nil)

Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module Mutant
# Current mutant version
VERSION = '0.10.33'
VERSION = '0.10.34'
end # Mutant
24 changes: 18 additions & 6 deletions spec/unit/mutant/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ def self.make
end

def self.main_body
<<~'MESSAGE'.strip
<<~MESSAGE.strip
usage: mutant <run|environment|subscription|util> [options]
Summary: mutation testing engine main command
mutant version: #{Mutant::VERSION}
Global Options:
--help Print help
Expand Down Expand Up @@ -169,13 +171,15 @@ def self.main_body
end

make do
message = <<~'MESSAGE'
message = <<~MESSAGE
mutant subscription: Missing required subcommand!
usage: mutant subscription <show|test> [options]
Summary: Subscription subcommands
mutant version: #{Mutant::VERSION}
Global Options:
--help Print help
Expand Down Expand Up @@ -207,11 +211,13 @@ def self.main_body
end

make do
message = <<~'MESSAGE'
message = <<~MESSAGE
usage: mutant subscription show [options]
Summary: Show subscription status
mutant version: #{Mutant::VERSION}
Global Options:
--help Print help
Expand All @@ -227,11 +233,13 @@ def self.main_body
end

make do
message = <<~'MESSAGE'
message = <<~MESSAGE
usage: mutant run [options]
Summary: Run code analysis
mutant version: #{Mutant::VERSION}
Global Options:
--help Print help
Expand Down Expand Up @@ -269,11 +277,13 @@ def self.main_body
end

make do
message = <<~'MESSAGE'
message = <<~MESSAGE
usage: mutant util <mutation> [options]
Summary: Utility subcommands
mutant version: #{Mutant::VERSION}
Global Options:
--help Print help
Expand All @@ -293,11 +303,13 @@ def self.main_body
end

make do
message = <<~'MESSAGE'
message = <<~MESSAGE
usage: mutant util mutation [options]
Summary: Print mutations of a code snippet
mutant version: #{Mutant::VERSION}
Global Options:
--help Print help
Expand Down

0 comments on commit 102c657

Please sign in to comment.