prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Show installed version in command-line
  I'd expect `mkdocs help` to display the currently installed version, would be nice to have for the next versions
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mkdocs/main.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 # coding: utf-8
  3 from __future__ import print_function
  4 
  5 import sys
  6 
  7 from mkdocs.build import build
  8 from mkdocs.config import load_config
  9 from mkdocs.exceptions import ConfigurationError
  10 from mkdocs.gh_deploy import gh_deploy
  11 from mkdocs.new import new
  12 from mkdocs.serve import serve
  13 
  14 
  15 def arg_to_option(arg):
  16     """
  17     Convert command line arguments into two-tuples of config key/value pairs.
  18     """
  19     arg = arg.lstrip('--')
  20     option = True
  21     if '=' in arg:
  22         arg, option = arg.split('=', 1)
  23     return (arg.replace('-', '_'), option)
  24 
  25 
  26 def main(cmd, args, options=None):
  27     """
  28     Build the documentation, and optionally start the devserver.
  29     """
  30     clean_site_dir = 'clean' in options
  31     if cmd == 'serve':
  32         config = load_config(options=options)
  33         serve(config, options=options)
  34     elif cmd == 'build':
  35         config = load_config(options=options)
  36         build(config, clean_site_dir=clean_site_dir)
  37     elif cmd == 'json':
  38         config = load_config(options=options)
  39         build(config, dump_json=True, clean_site_dir=clean_site_dir)
  40     elif cmd == 'gh-deploy':
  41         config = load_config(options=options)
  42         build(config, clean_site_dir=clean_site_dir)
  43         gh_deploy(config)
  44     elif cmd == 'new':
  45         new(args, options)
  46     else:
  47         print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')
  48 
  49 
  50 def run_main():
  51     """
  52     Invokes main() with the contents of sys.argv
  53 
  54     This is a separate function so it can be invoked
  55     by a setuptools console_script.
  56     """
  57     cmd = sys.argv[1] if len(sys.argv) >= 2 else None
  58     opts = [arg_to_option(arg) for arg in sys.argv[2:] if arg.startswith('--')]
  59     try:
  60         main(cmd, args=sys.argv[2:], options=dict(opts))
  61     except ConfigurationError as e:
  62         print(e.args[0], file=sys.stderr)
  63 
  64 
  65 if __name__ == '__main__':
  66     run_main()
  67
  ```
  --- 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/mkdocs/main.py b/mkdocs/main.py
  --- a/mkdocs/main.py
  +++ b/mkdocs/main.py
  @@ -4,6 +4,7 @@
   
   import sys
   
  +from mkdocs import __version__
   from mkdocs.build import build
   from mkdocs.config import load_config
   from mkdocs.exceptions import ConfigurationError
  @@ -44,6 +45,7 @@
       elif cmd == 'new':
           new(args, options)
       else:
  +        print('MkDocs (version {0})'.format(__version__))
           print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')
  
verification_info: {"golden_diff": "diff --git a/mkdocs/main.py b/mkdocs/main.py\n--- a/mkdocs/main.py\n+++ b/mkdocs/main.py\n@@ -4,6 +4,7 @@\n \n import sys\n \n+from mkdocs import __version__\n from mkdocs.build import build\n from mkdocs.config import load_config\n from mkdocs.exceptions import ConfigurationError\n@@ -44,6 +45,7 @@\n     elif cmd == 'new':\n         new(args, options)\n     else:\n+        print('MkDocs (version {0})'.format(__version__))\n         print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')\n", "issue": "Show installed version in command-line\nI'd expect `mkdocs help` to display the currently installed version, would be nice to have for the next versions\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# coding: utf-8\nfrom __future__ import print_function\n\nimport sys\n\nfrom mkdocs.build import build\nfrom mkdocs.config import load_config\nfrom mkdocs.exceptions import ConfigurationError\nfrom mkdocs.gh_deploy import gh_deploy\nfrom mkdocs.new import new\nfrom mkdocs.serve import serve\n\n\ndef arg_to_option(arg):\n    \"\"\"\n    Convert command line arguments into two-tuples of config key/value pairs.\n    \"\"\"\n    arg = arg.lstrip('--')\n    option = True\n    if '=' in arg:\n        arg, option = arg.split('=', 1)\n    return (arg.replace('-', '_'), option)\n\n\ndef main(cmd, args, options=None):\n    \"\"\"\n    Build the documentation, and optionally start the devserver.\n    \"\"\"\n    clean_site_dir = 'clean' in options\n    if cmd == 'serve':\n        config = load_config(options=options)\n        serve(config, options=options)\n    elif cmd == 'build':\n        config = load_config(options=options)\n        build(config, clean_site_dir=clean_site_dir)\n    elif cmd == 'json':\n        config = load_config(options=options)\n        build(config, dump_json=True, clean_site_dir=clean_site_dir)\n    elif cmd == 'gh-deploy':\n        config = load_config(options=options)\n        build(config, clean_site_dir=clean_site_dir)\n        gh_deploy(config)\n    elif cmd == 'new':\n        new(args, options)\n    else:\n        print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')\n\n\ndef run_main():\n    \"\"\"\n    Invokes main() with the contents of sys.argv\n\n    This is a separate function so it can be invoked\n    by a setuptools console_script.\n    \"\"\"\n    cmd = sys.argv[1] if len(sys.argv) >= 2 else None\n    opts = [arg_to_option(arg) for arg in sys.argv[2:] if arg.startswith('--')]\n    try:\n        main(cmd, args=sys.argv[2:], options=dict(opts))\n    except ConfigurationError as e:\n        print(e.args[0], file=sys.stderr)\n\n\nif __name__ == '__main__':\n    run_main()\n", "path": "mkdocs/main.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# coding: utf-8\nfrom __future__ import print_function\n\nimport sys\n\nfrom mkdocs import __version__\nfrom mkdocs.build import build\nfrom mkdocs.config import load_config\nfrom mkdocs.exceptions import ConfigurationError\nfrom mkdocs.gh_deploy import gh_deploy\nfrom mkdocs.new import new\nfrom mkdocs.serve import serve\n\n\ndef arg_to_option(arg):\n    \"\"\"\n    Convert command line arguments into two-tuples of config key/value pairs.\n    \"\"\"\n    arg = arg.lstrip('--')\n    option = True\n    if '=' in arg:\n        arg, option = arg.split('=', 1)\n    return (arg.replace('-', '_'), option)\n\n\ndef main(cmd, args, options=None):\n    \"\"\"\n    Build the documentation, and optionally start the devserver.\n    \"\"\"\n    clean_site_dir = 'clean' in options\n    if cmd == 'serve':\n        config = load_config(options=options)\n        serve(config, options=options)\n    elif cmd == 'build':\n        config = load_config(options=options)\n        build(config, clean_site_dir=clean_site_dir)\n    elif cmd == 'json':\n        config = load_config(options=options)\n        build(config, dump_json=True, clean_site_dir=clean_site_dir)\n    elif cmd == 'gh-deploy':\n        config = load_config(options=options)\n        build(config, clean_site_dir=clean_site_dir)\n        gh_deploy(config)\n    elif cmd == 'new':\n        new(args, options)\n    else:\n        print('MkDocs (version {0})'.format(__version__))\n        print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')\n\n\ndef run_main():\n    \"\"\"\n    Invokes main() with the contents of sys.argv\n\n    This is a separate function so it can be invoked\n    by a setuptools console_script.\n    \"\"\"\n    cmd = sys.argv[1] if len(sys.argv) >= 2 else None\n    opts = [arg_to_option(arg) for arg in sys.argv[2:] if arg.startswith('--')]\n    try:\n        main(cmd, args=sys.argv[2:], options=dict(opts))\n    except ConfigurationError as e:\n        print(e.args[0], file=sys.stderr)\n\n\nif __name__ == '__main__':\n    run_main()\n", "path": "mkdocs/main.py"}]}