lib/configliere/commands.rb
# Add a command, along with a description of its predicates and the command itself.
Add a command, along with a description of its predicates and the command itself.
Add a command along with a description of its predicates and the command itself .
def define_command cmd, options={}, &block
      cmd = cmd.to_sym
      command_configuration = Configliere::Param.new
      command_configuration.use :commandline, :env_var
      yield command_configuration if block_given?
      commands[cmd] = options
      commands[cmd][:config] = command_configuration
      commands[cmd]
    end
def define_command cmd , options = { } , & block cmd = cmd . to_sym command_configuration = Configliere :: Param . new command_configuration . use :commandline , :env_var yield command_configuration if block_given? commands [ cmd ] = options commands [ cmd ] [ :config ] = command_configuration commands [ cmd ] end
Add a command, along with a description of its predicates and the command itself.
Add a command along with a description of its predicates and the command itself .
cmd
options
block