// Generated by IcedCoffeeScript 1.7.1-c
(function() {
  var Base, Command, DecryptAndVerifyEngine, E, MyEngine, TrackSubSubCommand, chain, colors, dict_union, env, iced, log, make_esc, __iced_k, __iced_k_noop, _ref,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  iced = require('iced-runtime').iced;
  __iced_k = __iced_k_noop = function() {};

  Base = require('./base').Base;

  log = require('../log');

  E = require('../err').E;

  _ref = require('iced-error'), chain = _ref.chain, make_esc = _ref.make_esc;

  env = require('../env').env;

  dict_union = require('../util').dict_union;

  colors = require('../colors');

  DecryptAndVerifyEngine = require('../dve').DecryptAndVerifyEngine;

  TrackSubSubCommand = require('../tracksubsub').TrackSubSubCommand;

  MyEngine = (function(_super) {
    __extends(MyEngine, _super);

    function MyEngine(_arg) {
      var argv;
      argv = _arg.argv, this.cmd = _arg.cmd;
      MyEngine.__super__.constructor.call(this, {
        argv: argv
      });
    }

    MyEngine.prototype.do_output = function(out, cb) {
      return this.cmd.do_output(out, cb);
    };

    MyEngine.prototype.is_batch = function(out, cb) {
      return this.cmd.is_batch();
    };

    MyEngine.prototype.do_keypull = function(cb) {
      return this.cmd.do_keypull(cb);
    };

    MyEngine.prototype.patch_gpg_args = function(args) {
      return this.cmd.patch_gpg_args(args);
    };

    MyEngine.prototype.get_files = function(args) {
      return this.cmd.get_files(args);
    };

    return MyEngine;

  })(DecryptAndVerifyEngine);

  exports.Command = Command = (function(_super) {
    __extends(Command, _super);

    function Command() {
      return Command.__super__.constructor.apply(this, arguments);
    }

    Command.OPTS = dict_union(DecryptAndVerifyEngine.OPTS, {
      s: {
        alias: 'signed',
        action: 'storeTrue',
        help: "assert signed"
      },
      S: {
        alias: 'signed-by',
        help: "assert signed by the given user"
      },
      '6': {
        alias: "base64",
        action: "storeTrue",
        help: "output result as base64-encoded data"
      },
      m: {
        alias: "message",
        help: "provide the message on the command line"
      }
    });

    Command.prototype.run = function(cb) {
      var eng, err_dummy, esc, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      esc = make_esc(cb, "Command::run");
      eng = new MyEngine({
        argv: this.argv,
        cmd: this
      });
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/max/src/keybase/node-client/src/command/decrypt_and_verify.iced",
            funcname: "Command.run"
          });
          eng.global_init(esc(__iced_deferrals.defer({
            lineno: 51
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/Users/max/src/keybase/node-client/src/command/decrypt_and_verify.iced",
              funcname: "Command.run"
            });
            eng.run(esc(__iced_deferrals.defer({
              lineno: 52
            })));
            __iced_deferrals._fulfill();
          })(function() {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/Users/max/src/keybase/node-client/src/command/decrypt_and_verify.iced",
                funcname: "Command.run"
              });
              eng.global_cleanup(__iced_deferrals.defer({
                assign_fn: (function() {
                  return function() {
                    return err_dummy = arguments[0];
                  };
                })(),
                lineno: 53
              }));
              __iced_deferrals._fulfill();
            })(function() {
              return cb(null);
            });
          });
        };
      })(this));
    };

    return Command;

  })(Base);

}).call(this);
