Class: Pwl::Commands::List
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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pwl/commands/list.rb', line 4 def call(args, ) .default :separator => ' ' begin locker = open_locker() if !.long result = locker.list(args[0]).join(.separator) else matching_names = locker.list(args[0]) result = "total #{matching_names.size}#{$/}" matching_names.each do |name| e = locker.get(name) result << "#{e.uuid}\t#{e.name}#{$/}" end end if !result.blank? puts result else if args[0] # filter given exit_with(:list_empty_filter, .verbose, args[0]) else exit_with(:list_empty, .verbose) end end rescue Dialog::Cancelled exit_with(:aborted, .verbose) end end |