Skip to content

Commit

Permalink
search usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sentientwaffle committed Sep 14, 2012
1 parent d285cb3 commit 3cd014f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/search
Expand Up @@ -3,4 +3,12 @@
var exec = require('child_process').exec
, args = process.argv.slice(2).join(' ')

exec("xdg-open 'https://duckduckgo.com/?q=" + encodeURIComponent(args) + "'")
if (args) {
exec("xdg-open 'https://duckduckgo.com/?q=" + encodeURIComponent(args) + "'")
} else {
console.log()
console.log(" Usage:")
console.log()
console.log(" $ search <query>")
console.log()
}

0 comments on commit 3cd014f

Please sign in to comment.