module Mixlib::CLI::ClassMethods
def deprecated_option(name,
=== Returns
to non-deprecated keys in your code.
if no replacement is provided. You can use this to enforce the transition
only the value in `replacement` will be set. Results undefined
populated when the deprecated flag is used. If set to false,
keep
assigned directly to the converted option.
If not provided, the value provided to the deprecated option will be
and converts it to a value suitable for the new option.
value_mapper
boolean
short
long
replacement
name
Add a deprecated command line option.
Declare a deprecated option
def deprecated_option(name, replacement: nil, long: nil, short: nil, boolean: false, value_mapper: nil, keep: true) description = if replacement replacement_cfg = options[replacement] display_name = CLI::Formatter.combined_option_display_name(replacement_cfg[:short], replacement_cfg[:long]) "This flag is deprecated. Use #{display_name} instead." else "This flag is deprecated and will be removed in a future release." end value_mapper ||= Proc.new { |v| v } option(name, long: long, short: short, boolean: boolean, description: description, on: :tail, deprecated: true, keep: keep, replacement: replacement, value_mapper: value_mapper) end