prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Generate default config
  It should be possible to generate some basic config with a command line flag to opsdroid. It should cause opsdroid to print out the config so that is can be piped into a file.
  
  e.g
  
  ```
  opsdroid --gen-config > configuration.yaml
  ```
  
  
  </issue>
  <code>
  [start of opsdroid/__main__.py]
  1 """Starts opsdroid."""
  2 
  3 import logging
  4 
  5 from opsdroid.loader import Loader
  6 from opsdroid.core import OpsDroid
  7 from opsdroid.helper import set_logging_level
  8 from opsdroid.const import LOG_FILENAME
  9 
  10 
  11 def main():
  12     """The main function."""
  13     logging.basicConfig(filename=LOG_FILENAME, level=logging.INFO)
  14     logging.info("="*40)
  15     logging.info("Stated application")
  16     with OpsDroid() as opsdroid:
  17         loader = Loader(opsdroid)
  18         opsdroid.config = loader.load_config_file([
  19             "./configuration.yaml",
  20             "~/.opsdroid/configuration.yaml",
  21             "/etc/opsdroid/configuration.yaml"
  22             ])
  23         if "logging" in opsdroid.config:
  24             set_logging_level(opsdroid.config['logging'])
  25         loader.load_config(opsdroid.config)
  26         opsdroid.exit()
  27 
  28 if __name__ == "__main__":
  29     main()
  30
  [end of opsdroid/__main__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/opsdroid/__main__.py b/opsdroid/__main__.py
  --- a/opsdroid/__main__.py
  +++ b/opsdroid/__main__.py
  @@ -1,6 +1,9 @@
   """Starts opsdroid."""
   
  +import sys
  +import os
   import logging
  +import argparse
   
   from opsdroid.loader import Loader
   from opsdroid.core import OpsDroid
  @@ -8,11 +11,30 @@
   from opsdroid.const import LOG_FILENAME
   
   
  +def parse_args(args):
  +    """Parse command line arguments."""
  +    parser = argparse.ArgumentParser(description='Run opsdroid.')
  +    parser.add_argument('--gen-config', action="store_true",
  +                        help='prints out an example configuration file')
  +    return parser.parse_args(args)
  +
  +
   def main():
       """The main function."""
       logging.basicConfig(filename=LOG_FILENAME, level=logging.INFO)
       logging.info("="*40)
       logging.info("Stated application")
  +
  +    args = parse_args(sys.argv[1:])
  +
  +    if args.gen_config:
  +        path = os.path.join(
  +            os.path.dirname(os.path.abspath(__file__)),
  +            "configuration/example_configuration.yaml")
  +        with open(path, 'r') as conf:
  +            print(conf.read())
  +        sys.exit(0)
  +
       with OpsDroid() as opsdroid:
           loader = Loader(opsdroid)
           opsdroid.config = loader.load_config_file([
  
verification_info: {"golden_diff": "diff --git a/opsdroid/__main__.py b/opsdroid/__main__.py\n--- a/opsdroid/__main__.py\n+++ b/opsdroid/__main__.py\n@@ -1,6 +1,9 @@\n \"\"\"Starts opsdroid.\"\"\"\n \n+import sys\n+import os\n import logging\n+import argparse\n \n from opsdroid.loader import Loader\n from opsdroid.core import OpsDroid\n@@ -8,11 +11,30 @@\n from opsdroid.const import LOG_FILENAME\n \n \n+def parse_args(args):\n+    \"\"\"Parse command line arguments.\"\"\"\n+    parser = argparse.ArgumentParser(description='Run opsdroid.')\n+    parser.add_argument('--gen-config', action=\"store_true\",\n+                        help='prints out an example configuration file')\n+    return parser.parse_args(args)\n+\n+\n def main():\n     \"\"\"The main function.\"\"\"\n     logging.basicConfig(filename=LOG_FILENAME, level=logging.INFO)\n     logging.info(\"=\"*40)\n     logging.info(\"Stated application\")\n+\n+    args = parse_args(sys.argv[1:])\n+\n+    if args.gen_config:\n+        path = os.path.join(\n+            os.path.dirname(os.path.abspath(__file__)),\n+            \"configuration/example_configuration.yaml\")\n+        with open(path, 'r') as conf:\n+            print(conf.read())\n+        sys.exit(0)\n+\n     with OpsDroid() as opsdroid:\n         loader = Loader(opsdroid)\n         opsdroid.config = loader.load_config_file([\n", "issue": "Generate default config\nIt should be possible to generate some basic config with a command line flag to opsdroid. It should cause opsdroid to print out the config so that is can be piped into a file.\n\ne.g\n\n```\nopsdroid --gen-config > configuration.yaml\n```\n\n", "before_files": [{"content": "\"\"\"Starts opsdroid.\"\"\"\n\nimport logging\n\nfrom opsdroid.loader import Loader\nfrom opsdroid.core import OpsDroid\nfrom opsdroid.helper import set_logging_level\nfrom opsdroid.const import LOG_FILENAME\n\n\ndef main():\n    \"\"\"The main function.\"\"\"\n    logging.basicConfig(filename=LOG_FILENAME, level=logging.INFO)\n    logging.info(\"=\"*40)\n    logging.info(\"Stated application\")\n    with OpsDroid() as opsdroid:\n        loader = Loader(opsdroid)\n        opsdroid.config = loader.load_config_file([\n            \"./configuration.yaml\",\n            \"~/.opsdroid/configuration.yaml\",\n            \"/etc/opsdroid/configuration.yaml\"\n            ])\n        if \"logging\" in opsdroid.config:\n            set_logging_level(opsdroid.config['logging'])\n        loader.load_config(opsdroid.config)\n        opsdroid.exit()\n\nif __name__ == \"__main__\":\n    main()\n", "path": "opsdroid/__main__.py"}]}