def write(key, data, options = {})
      info = Utils.build_info(key, options)

      command "add-generic-password",
        "-a", info[:account_name],
        "-s", info[:service_name],
        "-l", info[:label],
        "-D", info[:kind],
        "-C", info[:type],
        "-T", "", # which applications have access (none)
        "-U", # upsert
        "-w", data
    end
def write(key, data, options = {})
      info = Utils.build_info(key, options)

      command "add-generic-password",
        "-a", info[:account_name],
        "-s", info[:service_name],
        "-l", info[:label],
        "-D", info[:kind],
        "-C", info[:type],
        "-T", "", # which applications have access (none)
        "-U", # upsert
        "-w", data
    end
Write data with given key to the keychain, or update existing key if it exists.

 @note keychain entries are not unique by key, but also by the information
       provided through options; two entries with same key but different
       account name (for example), will become two different entries when
       writing.

 @param [String] key
 @param [String] data
 @param [Hash] options
 @option options [#to_s] :type (:note) one of Mellon::TYPES
 @option options [String] :account_name ("")
 @option options [String] :service_name (key)
 @option options [String] :label (service_name)
 @raise [CommandError] if writing fails