-
-
Save alphapapa/51556e5e725d72e2593113e5c3b4d4e3 to your computer and use it in GitHub Desktop.
create pentadactyl commandline options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// createshortcut.js -- ++pentadactyl | |
// @Author: eric.zou (frederick.zou@gmail.com) | |
// @License: GPL (see http://www.gnu.org/licenses/gpl.txt) | |
// @Created: Tue 29 Nov 2011 01:24:05 PM CST | |
// @Last Change: Tue 29 Nov 2011 02:23:36 PM CST | |
// @Revision: 41 | |
// @Description: | |
// @Usage: | |
// @TODO: | |
// @CHANGES: | |
group.commands.add(["createshortcut"], | |
"Create Shortcut", | |
function (args) { | |
if (args.length == 0) | |
return false; | |
var command_ascii = args[0]; | |
if (args["-javascript"]) | |
command_ascii = "js " + command_ascii; | |
command_ascii = escape(command_ascii); | |
var output = <>-pentadactyl "++cmd 'execute unescape(<>{command_ascii}</>.toString())'"</>; | |
dactyl.echo(output, commandline.FORCE_MULTILINE); | |
}, | |
{ | |
argCount: "?", | |
literal: 0, | |
completer: function(context, args) { | |
if (!args["-javascript"]) | |
return completion.ex(context); | |
return completion.javascript(context); | |
}, | |
options: [ | |
{ | |
names: ["-javascript", "-js", "-j"], | |
description: "execute javascript code.", | |
type: CommandOption.NOARG, | |
completer: completion.javascript | |
} | |
] | |
}, | |
true | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment