prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  xoreutils: echo fails with KeyError: 'help'
  Any `echo` invocation fails:
  
  ```shell
  $ $XONSH_SHOW_TRACEBACK = True
  $ echo
  xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 13061, in run
      r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)
    File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12896, in proxy_four
      return f(args, stdin, stdout, stderr)
    File "/usr/local/lib/python3.6/site-packages/xonsh/xoreutils/echo.py", line 9, in echo
      if opts['help']:
  KeyError: 'help'
  $ echo foo
  xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 13061, in run
      r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)
    File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12896, in proxy_four
      return f(args, stdin, stdout, stderr)
    File "/usr/local/lib/python3.6/site-packages/xonsh/xoreutils/echo.py", line 9, in echo
      if opts['help']:
  KeyError: 'help'
  $ echo "foo"
  xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 13061, in run
      r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)
    File "/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 12896, in proxy_four
      return f(args, stdin, stdout, stderr)
    File "/usr/local/lib/python3.6/site-packages/xonsh/xoreutils/echo.py", line 9, in echo
      if opts['help']:
  KeyError: 'help'
  ```
  
  Obviously, the problem is that `help` is looked up but missing: http://xon.sh/_modules/xonsh/xoreutils/echo.html#echo
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `xonsh/xoreutils/echo.py`
  Content:
  ```
  1 """Implements a simple echo command for xonsh."""
  2 
  3 
  4 def echo(args, stdin, stdout, stderr):
  5     """A simple echo command."""
  6     opts = _echo_parse_args(args)
  7     if opts is None:
  8         return
  9     if opts['help']:
  10         print(ECHO_HELP, file=stdout)
  11         return 0
  12     ender = opts['end']
  13     args = map(str, args)
  14     if opts['escapes']:
  15         args = map(lambda x: x.encode().decode('unicode_escape'), args)
  16     print(*args, end=ender, file=stdout)
  17 
  18 
  19 def _echo_parse_args(args):
  20     out = {'escapes': False, 'end': '\n'}
  21     if '-e' in args:
  22         args.remove('-e')
  23         out['escapes'] = True
  24     if '-E' in args:
  25         args.remove('-E')
  26         out['escapes'] = False
  27     if '-n' in args:
  28         args.remove('-n')
  29         out['end'] = ''
  30     if '-h' in args or '--help' in args:
  31         out['help'] = True
  32     return out
  33 
  34 
  35 ECHO_HELP = """Usage: echo [OPTIONS]... [STRING]...
  36 Echo the STRING(s) to standard output.
  37 
  38   -n             do not include the trailing newline
  39   -e             enable interpretation of backslash escapes
  40   -E             disable interpretation of backslash escapes (default)
  41   -h  --help     display this message and exit
  42 
  43 This version of echo was written in Python for the xonsh project: http://xon.sh
  44 Based on echo from GNU coreutils: http://www.gnu.org/software/coreutils/"""
  45
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/xonsh/xoreutils/echo.py b/xonsh/xoreutils/echo.py
  --- a/xonsh/xoreutils/echo.py
  +++ b/xonsh/xoreutils/echo.py
  @@ -17,7 +17,7 @@
   
   
   def _echo_parse_args(args):
  -    out = {'escapes': False, 'end': '\n'}
  +    out = {'escapes': False, 'end': '\n', 'help': False}
       if '-e' in args:
           args.remove('-e')
           out['escapes'] = True
  
verification_info: {"golden_diff": "diff --git a/xonsh/xoreutils/echo.py b/xonsh/xoreutils/echo.py\n--- a/xonsh/xoreutils/echo.py\n+++ b/xonsh/xoreutils/echo.py\n@@ -17,7 +17,7 @@\n \n \n def _echo_parse_args(args):\n-    out = {'escapes': False, 'end': '\\n'}\n+    out = {'escapes': False, 'end': '\\n', 'help': False}\n     if '-e' in args:\n         args.remove('-e')\n         out['escapes'] = True\n", "issue": "xoreutils: echo fails with KeyError: 'help'\nAny `echo` invocation fails:\r\n\r\n```shell\r\n$ $XONSH_SHOW_TRACEBACK = True\r\n$ echo\r\nxonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py\", line 13061, in run\r\n    r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py\", line 12896, in proxy_four\r\n    return f(args, stdin, stdout, stderr)\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/xoreutils/echo.py\", line 9, in echo\r\n    if opts['help']:\r\nKeyError: 'help'\r\n$ echo foo\r\nxonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py\", line 13061, in run\r\n    r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py\", line 12896, in proxy_four\r\n    return f(args, stdin, stdout, stderr)\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/xoreutils/echo.py\", line 9, in echo\r\n    if opts['help']:\r\nKeyError: 'help'\r\n$ echo \"foo\"\r\nxonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py\", line 13061, in run\r\n    r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec)\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/__amalgam__.py\", line 12896, in proxy_four\r\n    return f(args, stdin, stdout, stderr)\r\n  File \"/usr/local/lib/python3.6/site-packages/xonsh/xoreutils/echo.py\", line 9, in echo\r\n    if opts['help']:\r\nKeyError: 'help'\r\n```\r\n\r\nObviously, the problem is that `help` is looked up but missing: http://xon.sh/_modules/xonsh/xoreutils/echo.html#echo\n", "before_files": [{"content": "\"\"\"Implements a simple echo command for xonsh.\"\"\"\n\n\ndef echo(args, stdin, stdout, stderr):\n    \"\"\"A simple echo command.\"\"\"\n    opts = _echo_parse_args(args)\n    if opts is None:\n        return\n    if opts['help']:\n        print(ECHO_HELP, file=stdout)\n        return 0\n    ender = opts['end']\n    args = map(str, args)\n    if opts['escapes']:\n        args = map(lambda x: x.encode().decode('unicode_escape'), args)\n    print(*args, end=ender, file=stdout)\n\n\ndef _echo_parse_args(args):\n    out = {'escapes': False, 'end': '\\n'}\n    if '-e' in args:\n        args.remove('-e')\n        out['escapes'] = True\n    if '-E' in args:\n        args.remove('-E')\n        out['escapes'] = False\n    if '-n' in args:\n        args.remove('-n')\n        out['end'] = ''\n    if '-h' in args or '--help' in args:\n        out['help'] = True\n    return out\n\n\nECHO_HELP = \"\"\"Usage: echo [OPTIONS]... [STRING]...\nEcho the STRING(s) to standard output.\n\n  -n             do not include the trailing newline\n  -e             enable interpretation of backslash escapes\n  -E             disable interpretation of backslash escapes (default)\n  -h  --help     display this message and exit\n\nThis version of echo was written in Python for the xonsh project: http://xon.sh\nBased on echo from GNU coreutils: http://www.gnu.org/software/coreutils/\"\"\"\n", "path": "xonsh/xoreutils/echo.py"}], "after_files": [{"content": "\"\"\"Implements a simple echo command for xonsh.\"\"\"\n\n\ndef echo(args, stdin, stdout, stderr):\n    \"\"\"A simple echo command.\"\"\"\n    opts = _echo_parse_args(args)\n    if opts is None:\n        return\n    if opts['help']:\n        print(ECHO_HELP, file=stdout)\n        return 0\n    ender = opts['end']\n    args = map(str, args)\n    if opts['escapes']:\n        args = map(lambda x: x.encode().decode('unicode_escape'), args)\n    print(*args, end=ender, file=stdout)\n\n\ndef _echo_parse_args(args):\n    out = {'escapes': False, 'end': '\\n', 'help': False}\n    if '-e' in args:\n        args.remove('-e')\n        out['escapes'] = True\n    if '-E' in args:\n        args.remove('-E')\n        out['escapes'] = False\n    if '-n' in args:\n        args.remove('-n')\n        out['end'] = ''\n    if '-h' in args or '--help' in args:\n        out['help'] = True\n    return out\n\n\nECHO_HELP = \"\"\"Usage: echo [OPTIONS]... [STRING]...\nEcho the STRING(s) to standard output.\n\n  -n             do not include the trailing newline\n  -e             enable interpretation of backslash escapes\n  -E             disable interpretation of backslash escapes (default)\n  -h  --help     display this message and exit\n\nThis version of echo was written in Python for the xonsh project: http://xon.sh\nBased on echo from GNU coreutils: http://www.gnu.org/software/coreutils/\"\"\"\n", "path": "xonsh/xoreutils/echo.py"}]}