// Generated by IcedCoffeeScript 1.7.1-c
(function() {
  var ArgumentParser, Base, Command, add_option_dict, iced, log, version_info, __iced_k, __iced_k_noop,
    __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');

  ArgumentParser = require('argparse').ArgumentParser;

  add_option_dict = require('./argparse').add_option_dict;

  version_info = require('../version').version_info;

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

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

    Command.prototype.add_subcommand_parser = function(scp) {
      var name, opts, sub;
      opts = {
        aliases: ["vers"],
        help: "output version information about this client"
      };
      name = "version";
      sub = scp.addParser(name, opts);
      return opts.aliases.concat([name]);
    };

    Command.prototype.run = function(cb) {
      var err, lines, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      (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/version.iced",
            funcname: "Command.run"
          });
          version_info(null, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                return lines = arguments[1];
              };
            })(),
            lineno: 23
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          if ((typeof err === "undefined" || err === null) && (typeof lines !== "undefined" && lines !== null)) {
            console.log(lines.join("\n"));
          }
          return cb(err);
        };
      })(this));
    };

    return Command;

  })(Base);

}).call(this);
