diff --git a/common/components/commandline-handler.js b/common/components/commandline-handler.js index 918d7bf3..e4362d97 100644 --- a/common/components/commandline-handler.js +++ b/common/components/commandline-handler.js @@ -40,8 +40,26 @@ CommandLineHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]), handle: function (commandLine) { + try { + var remote = commandLine.handleFlagWithParam(config.name + "-remote", false); + } + catch (e) { + util.dump("option '-" + config.name + "-remote' requires an argument\n"); + } + + try { + if (remote) { + commandLine.preventDefault = true; + require(global, "services"); + let win = services.windowMediator.getMostRecentWindow("navigator:browser"); + if (win && win.dactyl) + win.dactyl.execute(remote); + } + } + catch(e) { + util.reportError(e) + }; - // TODO: handle remote launches differently? try { this.optionValue = commandLine.handleFlagWithParam(config.name, false); } diff --git a/common/content/mow.js b/common/content/mow.js index 5c7a28c6..bd055746 100644 --- a/common/content/mow.js +++ b/common/content/mow.js @@ -135,7 +135,7 @@ var MOW = Module("mow", { this.messages.push(data); } else { - let style = isString(data) ? "pre" : "nowrap"; + let style = isString(data) ? "pre-wrap" : "nowrap"; this.lastOutput =
{data}
; var output = util.xmlToDom(this.lastOutput, this.document); diff --git a/common/locale/en-US/messages.properties b/common/locale/en-US/messages.properties index e9c29911..2c373047 100644 --- a/common/locale/en-US/messages.properties +++ b/common/locale/en-US/messages.properties @@ -236,6 +236,7 @@ mow.contextMenu.selectAll = Select All option.noSuch = No such option option.noSuch-1 = No such option: %S +option.noSuchType-1 = No such option type: %S option.replaceExisting-1 = Warning: %S already exists: replacing existing option option.intRequired = Integer value required option.operatorNotSupported-2 = Operator %S not supported for option type %S diff --git a/common/locale/en-US/starting.xml b/common/locale/en-US/starting.xml index 38935504..39e1c40e 100644 --- a/common/locale/en-US/starting.xml +++ b/common/locale/en-US/starting.xml @@ -15,11 +15,16 @@

Command-line options

- Command-line options can be passed to &dactyl.appName; via the -&dactyl.name; &dactyl.host; + Command-line options can be passed to &dactyl.appName; via the -&dactyl.name; &dactyl.host; option. These are passed as single string argument. E.g., &dactyl.hostbin; -&dactyl.name; ++cmd 'set exrc' +u 'tempRcFile' ++noplugin

+

+ The -&dactyl.name;-remote command-line option can be used to + execute a single Ex command in an already running Pentadactyl instance. +

+ +c diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index 206dc902..95d4b2eb 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -26,6 +26,7 @@ defineModule("commands", { * @property {number} type The option's value type. This is one of: * (@link CommandOption.NOARG), * (@link CommandOption.STRING), + * (@link CommandOption.STRINGMAP), * (@link CommandOption.BOOL), * (@link CommandOption.INT), * (@link CommandOption.FLOAT), @@ -72,6 +73,11 @@ update(CommandOption, { * @final */ STRING: ArgType("string", function (val) val), + /** + * @property {object} The option accepts a stringmap argument. + * @final + */ + STRINGMAP: ArgType("stringmap", function (val, quoted) Option.parse.stringmap(quoted)), /** * @property {object} The option accepts an integer argument. * @final @@ -765,7 +771,7 @@ var Commands = Module("commands", { let str = args.literalArg; if (str) res.push(!/\n/.test(str) ? str : - this.hereDoc && false ? "<. See :h 'editor'. [b4] • Improved [macro-string] support, including automatic elision of optional elements, and array subscripts. [b4][b7] + • Add -pentadactyl-remote command-line option. [b8] • Improvements to marks: - Marks are now stored as line and column ordinals rather than percentages. [b8] - Marks now store the marked element and ensure its visibility when followed. [b8]