Skip to content

Instantly share code, notes, and snippets.

@andrewsomething
Created January 16, 2009 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewsomething/47723 to your computer and use it in GitHub Desktop.
Save andrewsomething/47723 to your computer and use it in GitHub Desktop.
/* Ubuntu Man Page Search
* Andrew Starr-Bochicchio <andrewsomething@ubuntu.com>
* MIT/X11 License
*/
CmdUtils.CreateCommand({
name: "ubuntu-man",
icon: "http://www.ubuntu.com/files/favicon-ubuntu.ico",
homepage: "http://manpages.ubuntu.com/",
author: { name: "Andrew Starr-Bochicchio", email: "andrewsomething@ubuntu.com"},
license: "MIT",
description: "Ubuntu Man Page Search",
help: "ubuntu-man [package]",
takes: {"package": noun_arb_text},
preview: function(pblock, package, mods) {
var template = "Search for ${name} at manpages.ubuntu.com";
pblock.innerHTML = CmdUtils.renderTemplate(template, {"name": package.text});
},
execute: function(package) {
var url = "http://manpages.ubuntu.com/manpages/" + package.text;
Utils.openUrlInBrowser(url);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment