logout.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Generated by IcedCoffeeScript 1.7.1-c
  2. (function() {
  3. var ArgumentParser, Base, Command, E, PackageJson, add_option_dict, iced, log, session, __iced_k, __iced_k_noop,
  4. __hasProp = {}.hasOwnProperty,
  5. __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; };
  6. iced = require('iced-runtime').iced;
  7. __iced_k = __iced_k_noop = function() {};
  8. Base = require('./base').Base;
  9. log = require('../log');
  10. ArgumentParser = require('argparse').ArgumentParser;
  11. add_option_dict = require('./argparse').add_option_dict;
  12. PackageJson = require('../package').PackageJson;
  13. E = require('../err').E;
  14. session = require('../session').session;
  15. exports.Command = Command = (function(_super) {
  16. __extends(Command, _super);
  17. function Command() {
  18. return Command.__super__.constructor.apply(this, arguments);
  19. }
  20. Command.prototype.use_session = function() {
  21. return true;
  22. };
  23. Command.prototype.add_subcommand_parser = function(scp) {
  24. var name, opts, sub;
  25. opts = {
  26. help: "logout from the server"
  27. };
  28. name = "logout";
  29. sub = scp.addParser(name, opts);
  30. return [name];
  31. };
  32. Command.prototype.run = function(cb) {
  33. var err, ___iced_passed_deferral, __iced_deferrals, __iced_k;
  34. __iced_k = __iced_k_noop;
  35. ___iced_passed_deferral = iced.findDeferral(arguments);
  36. (function(_this) {
  37. return (function(__iced_k) {
  38. __iced_deferrals = new iced.Deferrals(__iced_k, {
  39. parent: ___iced_passed_deferral,
  40. filename: "/Users/max/src/keybase/node-client/src/command/logout.iced",
  41. funcname: "Command.run"
  42. });
  43. session.logout(__iced_deferrals.defer({
  44. assign_fn: (function() {
  45. return function() {
  46. return err = arguments[0];
  47. };
  48. })(),
  49. lineno: 29
  50. }));
  51. __iced_deferrals._fulfill();
  52. });
  53. })(this)((function(_this) {
  54. return function() {
  55. return cb(err);
  56. };
  57. })(this));
  58. };
  59. return Command;
  60. })(Base);
  61. }).call(this);