CmdUtils.CreateCommand({
  names: ["bsdman"],
  homepage: "http://www.trolocsis.com/ubiquity/",
  author: { 'name': 'Ryan Phillips', email : 'trolocsis@gmail.com' },
  license: "MPL", 
  description: "search for bsd man pages",
  arguments: [{role: "object", nountype: noun_arb_text, label: "manpage"}],
  preview: function( pblock, args) {
    if (args.object.text.length > 0) {
      jQuery.get("http://www.trolocsis.com/ubiquity/bsdman.php", {'keyword':args.object.text}, function( data ) {
        pblock.innerHTML = data;
      })
    }
  },
  execute: function(args) {
    var url = "http://www.freebsd.org/cgi/man.cgi?query={QUERY}&apropos=0&sektion=0&manpath=FreeBSD+7.2-RELEASE+and+Ports&format=html"
    var urlString = url.replace("{QUERY}", escape(args.object.text));
    Utils.openUrlInBrowser(urlString);
  }
});


