def run(input_path, output_path = nil)
self.decrypt_to ||= decrypt_to_for(input_path)
output_path ||= File.basename(output_path_for(input_path))
self.output = $stdout.tty? ? StringIO.new : $stderr if output_path == '-'
result = transcode(input_path)
if output_path == '-'
$stdout.puts result
else
say "storing result as #{color(output_path, :info)}"
write_file(output_path, result, force)
return if decrypt?
error "requires --decrypt-to option when reading from stdin" unless decrypt_to?
set_env_vars
command = decrypt_command(output_path)
stage ? store_command(command) : print_command(command)
notes(input_path, output_path)
end
end