lib/cri/command_dsl.rb in cri-2.15.9 vs lib/cri/command_dsl.rb in cri-2.15.10

- old
+ new

@@ -213,13 +213,13 @@ # @return [void] # # @deprecated # # @see #option - def required(short, long, desc, params = {}, &block) + def required(short, long, desc, **params, &block) params = params.merge(argument: :required) - option(short, long, desc, params, &block) + option(short, long, desc, **params, &block) end # Adds a new option with a forbidden argument to the command. If a block # is given, it will be executed when the option is successfully parsed. # @@ -236,13 +236,13 @@ # be printed in the help output # # @return [void] # # @see #option - def flag(short, long, desc, params = {}, &block) + def flag(short, long, desc, **params, &block) params = params.merge(argument: :forbidden) - option(short, long, desc, params, &block) + option(short, long, desc, **params, &block) end alias forbidden flag # Adds a new option with an optional argument to the command. If a block # is given, it will be executed when the option is successfully parsed. @@ -262,12 +262,12 @@ # @return [void] # # @deprecated # # @see #option - def optional(short, long, desc, params = {}, &block) + def optional(short, long, desc, **params, &block) params = params.merge(argument: :optional) - option(short, long, desc, params, &block) + option(short, long, desc, **params, &block) end # Sets the run block to the given block. The given block should have two # or three arguments (options, arguments, and optionally the command). # Calling this will override existing run block or runner declarations