1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-19 22:57:59 +01:00

Add -pentadactyl-remote command-line flag and CommandOption.STRINGMAP type.

--HG--
extra : rebase_source : a306ad6e8c2d019b92a6ff58414eb3ff8ab149b9
This commit is contained in:
Kris Maglione
2011-08-12 17:27:46 -04:00
parent 0bcba9fb23
commit 5e86f4ed93
8 changed files with 42 additions and 5 deletions

View File

@@ -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);
}