浏览代码

Update `hello`, `exit` and `search` help text

Weiyi Lou 10 年之前
父节点
当前提交
a34f64f00d
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      js/pgsh.js

+ 4 - 3
js/pgsh.js

@@ -37,7 +37,7 @@ Type "help" for list of commands\n\
       }
     },
     'hello': {
-      'help': 'Usage: hello [name]',
+      'help': 'Say hello to the computer\nUsage: hello [name]',
       'run': function(args) {
         address = args.join(' ').trim()
         if (address.length == 0) {
@@ -70,7 +70,7 @@ Type "help" for list of commands\n\
       }
     },
     'exit': {
-      'help': 'Usage: exit',
+      'help': 'Leave the current context\nUsage: exit',
       'run': function(args, shell, terminal) {
         if (args.length > 0) { return this.help }
         var output = 'Close browser window to exit'
@@ -83,8 +83,9 @@ Type "help" for list of commands\n\
       }
     },
     'search': {
-      'help': 'Search the web\nUsage: search [query]',
+      'help': 'Search the Web (with a Duck)\nUsage: search [query]',
       'run': function(args, shell, terminal) {
+        if (!args.join(' ').trim()) { return this.help }
         terminal.commandline.hidePrompt()
         setTimeout(function() {
           window.open('https://duckduckgo.com/?q=' + args.join('+'), '_blank')