Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added result context variable for returns from .io .yql .headers

  • Loading branch information...
commit 0912b64bc6eb428c1edab109fcbe889fe4938076 1 parent 4d712e5
@davglass authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/repl.js
View
4 lib/repl.js
@@ -32,6 +32,7 @@ exports.startPrompt = function(Y) {
if (write !== false) {
this.displayPrompt();
}
+ delete this.context.result;
};
repl.defineCommand('help', {
@@ -171,6 +172,7 @@ exports.startPrompt = function(Y) {
var str;
try {
var data = JSON.parse(e.responseText);
+ self.context.result = data;
str = util.inspect(data, false, Infinity, true);
} catch (e) {
str = e.responseText;
@@ -200,6 +202,7 @@ exports.startPrompt = function(Y) {
self.outputStream.write(' [done]\n'.white);
self.outputStream.write(' (' + (e.status + '').green + ' ' + e.statusText + '): Content-Type: "' + e.headers['content-type'].green + '"\n\n'.white);
var str = util.inspect(e.headers, false, Infinity, true);
+ self.context.result = e.headers;
self.outputStream.write(str);
self.outputStream.write('\n\n');
self.displayPrompt();
@@ -229,6 +232,7 @@ exports.startPrompt = function(Y) {
var str;
try {
str = util.inspect(r.query.results, false, Infinity, true);
+ self.context.result = r.query.results;
} catch (e) {
str = util.inspect(r, false, Infinity, true);
}
Please sign in to comment.
Something went wrong with that request. Please try again.