Class: Textus::CLI::Verb::Mv

Inherits:
Textus::CLI::Verb show all
Defined in:
lib/textus/cli/verb/mv.rb

Instance Attribute Summary

Attributes inherited from Textus::CLI::Verb

#positional

Instance Method Summary collapse

Methods inherited from Textus::CLI::Verb

#context_for, #emit, inherited, #initialize, needs_store?, #operations_for, option, options, #parse, #resolved_role

Constructor Details

This class inherits a constructor from Textus::CLI::Verb

Instance Method Details

#call(store) ⇒ Object



8
9
10
11
12
# File 'lib/textus/cli/verb/mv.rb', line 8

def call(store)
  old_key = positional.shift or raise UsageError.new("mv requires <old-key> <new-key>")
  new_key = positional.shift or raise UsageError.new("mv requires <old-key> <new-key>")
  emit(operations_for(store).writes.mv.call(old_key, new_key, dry_run: dry_run || false))
end