From 46b2fde2d92869cf9be7cb39640922246ce5d803 Mon Sep 17 00:00:00 2001
From: Jeremy Ruston
Date: Fri, 9 Aug 2013 09:24:58 +0100
Subject: [PATCH] Rename "dump" command to "print" command
Being pan-cultural is hard.
---
core/modules/commands/dump.js | 32 +++++++--------
.../tw5.com/tiddlers/commands/DumpCommand.tid | 28 +++++++------
readme.md | 40 ++++++++++---------
3 files changed, 52 insertions(+), 48 deletions(-)
diff --git a/core/modules/commands/dump.js b/core/modules/commands/dump.js
index 4a9c9a184..8edcd8908 100644
--- a/core/modules/commands/dump.js
+++ b/core/modules/commands/dump.js
@@ -1,9 +1,9 @@
/*\
-title: $:/core/modules/commands/dump.js
+title: $:/core/modules/commands/print.js
type: application/javascript
module-type: command
-Dump command for inspecting TiddlyWiki internals
+Print command for inspecting TiddlyWiki internals
\*/
(function(){
@@ -13,7 +13,7 @@ Dump command for inspecting TiddlyWiki internals
"use strict";
exports.info = {
- name: "dump",
+ name: "print",
synchronous: true
};
@@ -25,13 +25,13 @@ var Command = function(params,commander) {
Command.prototype.execute = function() {
if(this.params.length < 1) {
- return "Too few parameters for dump command";
+ 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 dump command";
+ return "Unknown subcommand (" + this.params[0] + ") for print command";
}
};
@@ -39,7 +39,7 @@ Command.prototype.subcommands = {};
Command.prototype.subcommands.tiddler = function() {
if(this.params.length < 2) {
- return "Too few parameters for dump tiddler command";
+ return "Too few parameters for print tiddler command";
}
var tiddler = this.commander.wiki.getTiddler(this.params[1]);
if(!tiddler) {
@@ -80,11 +80,11 @@ Command.prototype.subcommands.config = function() {
return "[\"" + $tw.utils.stringify(p) + "\"]";
}
},
- dumpConfig = function(object,prefix) {
+ printConfig = function(object,prefix) {
for(var n in object) {
var v = object[n];
if(typeof v === "object") {
- dumpConfig(v,prefix + "." + quotePropertyName(n));
+ printConfig(v,prefix + "." + quotePropertyName(n));
} else if(typeof v === "string") {
self.output.write(prefix + "." + quotePropertyName(n) + ": \"" + $tw.utils.stringify(v) + "\"\n");
} else {
@@ -92,20 +92,20 @@ Command.prototype.subcommands.config = function() {
}
}
},
- dumpObject = function(heading,object) {
+ printObject = function(heading,object) {
self.output.write(heading +"\n");
for(var n in object) {
self.output.write(" " + n + "\n");
}
};
this.output.write("Configuration:\n");
- dumpConfig($tw.config," $tw.config");
- dumpObject("Tiddler field modules:",$tw.Tiddler.fieldModules);
- dumpObject("Loaded modules:",$tw.modules.titles);
- dumpObject("Command modules:",$tw.commands);
- dumpObject("Parser modules:",$tw.wiki.parsers);
- dumpObject("Macro modules:",$tw.wiki.macros);
- dumpObject("Deserializer modules:",$tw.Wiki.tiddlerDeserializerModules);
+ printConfig($tw.config," $tw.config");
+ printObject("Tiddler field modules:",$tw.Tiddler.fieldModules);
+ printObject("Loaded modules:",$tw.modules.titles);
+ printObject("Command modules:",$tw.commands);
+ printObject("Parser modules:",$tw.wiki.parsers);
+ printObject("Macro modules:",$tw.wiki.macros);
+ printObject("Deserializer modules:",$tw.Wiki.tiddlerDeserializerModules);
return null; // No error
};
diff --git a/editions/tw5.com/tiddlers/commands/DumpCommand.tid b/editions/tw5.com/tiddlers/commands/DumpCommand.tid
index cd93ca992..512d70177 100644
--- a/editions/tw5.com/tiddlers/commands/DumpCommand.tid
+++ b/editions/tw5.com/tiddlers/commands/DumpCommand.tid
@@ -1,34 +1,36 @@
-title: DumpCommand
+title: PrintCommand
tags: docs command
-!!! dump tiddlers
+The `print` command outputs specified information.
-Dump the titles of the tiddlers in the wiki store
+!!! print tiddlers
+
+Output the titles of the tiddlers in the wiki store
```
---dump tiddlers
+--print tiddlers
```
-!!! dump tiddler
+!!! print tiddler
-Dump the fields of an individual tiddler
+Print the fields of an individual tiddler
```
---dump tiddler
+--print tiddler
```
-!!! dump system
+!!! print system
-Dump the titles of the system tiddlers in the wiki store
+Print the titles of the system tiddlers in the wiki store
```
---dump systems
+--print system
```
-!!! dump config
+!!! print config
-Dump the current core configuration
+Print the current core configuration
```
---dump config
+--print config
```
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 37db10f3d..b1acbb726 100644
--- a/readme.md
+++ b/readme.md
@@ -126,25 +126,6 @@ The following commands are available:
-
-
-dump tiddlers
-Dump the titles of the tiddlers in the wiki store
---dump tiddlers
-dump tiddler
-Dump the fields of an individual tiddler
---dump tiddler <title>
-dump system
-Dump the titles of the system tiddlers in the wiki store
---dump systems
-dump config
-Dump the current core configuration
---dump config
-
-
@@ -159,6 +140,27 @@ TiddlyWiki files (
+
+
+The
+print
command outputs specified information.
+print tiddlers
+Output the titles of the tiddlers in the wiki store
+--print tiddlers
+print tiddler
+Print the fields of an individual tiddler
+--print tiddler <title>
+print system
+Print the titles of the system tiddlers in the wiki store
+--print system
+print config
+Print the current core configuration
+--print config