};
+var natives = process.binding('natives');
+
+
Client.prototype._addScript = function(desc) {
this.scripts[desc.id] = desc;
+ desc.isNative = (desc.name.replace('.js', '') in natives) ||
+ desc.name == 'node.js';
};
self.printNotConnected();
return;
}
- self.printScripts();
+ self.printScripts(cmd.indexOf('full') > 0);
term.prompt();
} else if (/^c(ontinue)?/.test(cmd)) {
};
-Interface.prototype.printScripts = function() {
+// argument full tells if it should display internal node scripts or not
+Interface.prototype.printScripts = function(displayNatives) {
var client = this.client;
var text = '';
for (var id in client.scripts) {
var script = client.scripts[id];
if (typeof script == 'object' && script.name) {
- text += script.name == client.currentScript ? '* ' : ' ';
- text += script.name + '\n';
+ if (displayNatives || script.name == client.currentScript || !script.isNative) {
+ text += script.name == client.currentScript ? '* ' : ' ';
+ text += script.name + '\n';
+ }
}
}
process.stdout.write(text);