From 8ce7c3920ce4caea00728c40b149156d1bb34edc Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 25 Feb 2014 14:47:19 +0000 Subject: [PATCH] Get rid of the old print command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’ll be introducing a help command to replace it --- core/modules/commands/print.js | 114 ------------------ .../tiddlers/commands/PrintCommand.tid | 36 ------ 2 files changed, 150 deletions(-) delete mode 100644 core/modules/commands/print.js delete mode 100644 editions/tw5.com/tiddlers/commands/PrintCommand.tid diff --git a/core/modules/commands/print.js b/core/modules/commands/print.js deleted file mode 100644 index 8edcd8908..000000000 --- a/core/modules/commands/print.js +++ /dev/null @@ -1,114 +0,0 @@ -/*\ -title: $:/core/modules/commands/print.js -type: application/javascript -module-type: command - -Print command for inspecting TiddlyWiki internals - -\*/ -(function(){ - -/*jshint node: true, browser: true */ -/*global $tw: false */ -"use strict"; - -exports.info = { - name: "print", - synchronous: true -}; - -var Command = function(params,commander) { - this.params = params; - this.commander = commander; - this.output = commander.streams.output; -}; - -Command.prototype.execute = function() { - if(this.params.length < 1) { - return "Too few parameters for print command"; - } - var subcommand = this.subcommands[this.params[0]]; - if(subcommand) { - return subcommand.call(this); - } else { - return "Unknown subcommand (" + this.params[0] + ") for print command"; - } -}; - -Command.prototype.subcommands = {}; - -Command.prototype.subcommands.tiddler = function() { - if(this.params.length < 2) { - return "Too few parameters for print tiddler command"; - } - var tiddler = this.commander.wiki.getTiddler(this.params[1]); - if(!tiddler) { - return "No such tiddler as '" + this.params[1] + "'"; - } - this.output.write("Tiddler '" + this.params[1] + "' contains these fields:\n"); - for(var t in tiddler.fields) { - this.output.write(" " + t + ": " + tiddler.getFieldString(t) + "\n"); - } - return null; // No error -}; - -Command.prototype.subcommands.tiddlers = function() { - var tiddlers = this.commander.wiki.getTiddlers(); - this.output.write("Wiki contains these tiddlers:\n"); - for(var t=0; t -``` - -!!! print system - -Print the titles of the system tiddlers in the wiki store - -``` ---print system -``` - -!!! print config - -Print the current core configuration - -``` ---print config -``` \ No newline at end of file