Class: Pwl::Commands::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/pwl/commands/delete.rb

Instance Method Summary collapse

Methods inherited from Base

default_locker_file, exit_codes_help

Instance Method Details

#call(args, options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/pwl/commands/delete.rb', line 4

def call(args, options)
  exit_with(:name_blank, options.verbose) if 0 == args.size || args[0].blank?

  begin
    locker = open_locker(options)
  rescue Pwl::Dialog::Cancelled
    exit_with(:aborted, options.verbose)
  end

  locker.delete(args[0])
  msg "Successfully deleted the value under #{args[0]}." if options.verbose
end