diff options
author | Doug Kearns <dougkearns@gmail.com> | 2009-05-28 00:47:30 +1000 |
---|---|---|
committer | Doug Kearns <dougkearns@gmail.com> | 2009-05-28 20:28:51 +1000 |
commit | 0edefd5dc26e8ff626983db45754ea0484122e1f (patch) | |
tree | 694d8b8595c005d644726feaae3632efb6ea3199 /muttator/components | |
parent | 451e7af170710d573851921e1c3bfbc6dccefc4c (diff) | |
download | pentadactyl-0edefd5dc26e8ff626983db45754ea0484122e1f.tar.gz |
Add a command-line handler to process the -liberator option.
Diffstat (limited to 'muttator/components')
-rw-r--r-- | muttator/components/commandline-handler.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/muttator/components/commandline-handler.js b/muttator/components/commandline-handler.js new file mode 100644 index 00000000..a4d1f2e4 --- /dev/null +++ b/muttator/components/commandline-handler.js @@ -0,0 +1,39 @@ +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + +function CommandLineHandler() +{ + this.wrappedJSObject = this; +} + +CommandLineHandler.prototype = { + + classDescription: "Liberator Command-line Handler", + + classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"), + + contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=liberator", + + _xpcom_categories: [{ + category: "command-line-handler", + entry: "m-liberator" + }], + + QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]), + + handle: function (commandLine) + { + // TODO: handle remote launches differently? + try + { + this.optionValue = commandLine.handleFlagWithParam("liberator", false); + } + catch (e) + { + //"liberator: option -liberator requires an argument" + } + } +}; + +function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]); + +// vim: set fdm=marker sw=4 ts=4 et: |