verify.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Generated by IcedCoffeeScript 1.7.1-c
  2. (function() {
  3. var BufferInStream, BufferOutStream, Command, E, add_option_dict, dv, env, _ref,
  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. dv = require('./decrypt_and_verify');
  7. add_option_dict = require('./argparse').add_option_dict;
  8. env = require('../env').env;
  9. _ref = require('iced-spawn'), BufferOutStream = _ref.BufferOutStream, BufferInStream = _ref.BufferInStream;
  10. E = require('../err').E;
  11. exports.Command = Command = (function(_super) {
  12. __extends(Command, _super);
  13. function Command() {
  14. return Command.__super__.constructor.apply(this, arguments);
  15. }
  16. Command.prototype.set_argv = function(a) {
  17. var n;
  18. if ((n = a.files.length) > 2) {
  19. return new E.ArgsError("Expected 1 or 2 files; got " + n);
  20. } else {
  21. return Command.__super__.set_argv.call(this, a);
  22. }
  23. };
  24. Command.prototype.add_subcommand_parser = function(scp) {
  25. var name, opts, sub;
  26. opts = {
  27. aliases: [],
  28. help: "verify a file"
  29. };
  30. name = "verify";
  31. sub = scp.addParser(name, opts);
  32. add_option_dict(sub, dv.Command.OPTS);
  33. sub.addArgument(["files"], {
  34. nargs: '*'
  35. });
  36. return opts.aliases.concat([name]);
  37. };
  38. Command.prototype.do_keypull = function(cb) {
  39. return cb(null);
  40. };
  41. Command.prototype.do_output = function(out, cb) {
  42. return cb(null);
  43. };
  44. Command.prototype.patch_gpg_args = function(args) {
  45. return args.push("--verify");
  46. };
  47. Command.prototype.get_files = function(args) {
  48. var _ref1;
  49. if ((_ref1 = this.argv.files) != null ? _ref1.length : void 0) {
  50. args.push.apply(args, this.argv.files);
  51. return true;
  52. } else {
  53. return false;
  54. }
  55. };
  56. return Command;
  57. })(dv.Command);
  58. }).call(this);