Updated to use Inspec.deprecate instead of log to deprecate the --hook option

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2021-05-24 18:05:18 +05:30
parent a3feab0943
commit 6a45164e87
2 changed files with 6 additions and 1 deletions

View file

@ -120,6 +120,11 @@
"object_classes": {
"action": "warn",
"suffix": "These classes will be removed in InSpec 5.0."
},
"cli_option_hook":{
"action": "warn",
"prefix": "The --hook option is being replaced by the --activator option.",
"suffix": "This options will be removed in InSpec 4.0."
}
}
}

View file

@ -32,7 +32,7 @@ module InspecPlugins
# Handle deprecation of option --hook
unless options[:hook].nil?
Inspec::Log.warn("Use --activator on the command line instead of --hook. --hook option will be deprecated in future.")
Inspec.deprecate "cli_option_hook"
options[:activator] = options.delete(:hook)
end