From c28d3bccbe7226cd822e176bd55de2d0971c3fc5 Mon Sep 17 00:00:00 2001 From: Adam Leff Date: Tue, 7 Feb 2017 15:25:31 -0500 Subject: [PATCH] Add support for "inspec -v" showing the version The other Chef tooling (chef-client, chef, kitchen, berks, etc.) support a `-v` flag to display the version. Currently, inspec errors out with the following error: ``` Could not find command "_v". ``` This adds a Thor map so that `-v` executes the `version` command. Signed-off-by: Adam Leff --- lib/inspec/cli.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/inspec/cli.rb b/lib/inspec/cli.rb index 964157462..57f0bfd65 100644 --- a/lib/inspec/cli.rb +++ b/lib/inspec/cli.rb @@ -230,6 +230,7 @@ class Inspec::InspecCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength puts "\nYour version of InSpec is out of date! The latest version is #{latest}." end end + map %w{-v --version} => :version private