track.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Generated by IcedCoffeeScript 1.7.1-c
  2. (function() {
  3. var Base, Command, E, TrackSubSubCommand, add_option_dict, iced, log, __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. add_option_dict = require('./argparse').add_option_dict;
  11. E = require('../err').E;
  12. TrackSubSubCommand = require('../tracksubsub').TrackSubSubCommand;
  13. exports.Command = Command = (function(_super) {
  14. __extends(Command, _super);
  15. function Command() {
  16. return Command.__super__.constructor.apply(this, arguments);
  17. }
  18. Command.prototype.OPTS = TrackSubSubCommand.OPTS;
  19. Command.prototype.needs_configuration = function() {
  20. return true;
  21. };
  22. Command.prototype.add_subcommand_parser = function(scp) {
  23. var name, opts, sub;
  24. opts = {
  25. aliases: [],
  26. help: "verify a user's authenticity and optionally track them"
  27. };
  28. name = "track";
  29. sub = scp.addParser(name, opts);
  30. add_option_dict(sub, this.OPTS);
  31. sub.addArgument(["them"], {
  32. nargs: 1
  33. });
  34. return opts.aliases.concat([name]);
  35. };
  36. Command.prototype.run = function(cb) {
  37. var err, tssc, ___iced_passed_deferral, __iced_deferrals, __iced_k;
  38. __iced_k = __iced_k_noop;
  39. ___iced_passed_deferral = iced.findDeferral(arguments);
  40. tssc = new TrackSubSubCommand({
  41. args: {
  42. them: this.argv.them[0]
  43. },
  44. opts: this.argv
  45. });
  46. (function(_this) {
  47. return (function(__iced_k) {
  48. __iced_deferrals = new iced.Deferrals(__iced_k, {
  49. parent: ___iced_passed_deferral,
  50. filename: "/home/max/src/keybase/node-client/src/command/track.iced",
  51. funcname: "Command.run"
  52. });
  53. tssc.run(__iced_deferrals.defer({
  54. assign_fn: (function() {
  55. return function() {
  56. return err = arguments[0];
  57. };
  58. })(),
  59. lineno: 34
  60. }));
  61. __iced_deferrals._fulfill();
  62. });
  63. })(this)((function(_this) {
  64. return function() {
  65. if (typeof err === "undefined" || err === null) {
  66. log.info('Success!');
  67. }
  68. return cb(err);
  69. };
  70. })(this));
  71. };
  72. return Command;
  73. })(Base);
  74. }).call(this);