Repository: facebookresearch/hydra (python)

Issue:
[Bug] --cfg not working
# 🐛 Bug

when running `python main.py --cfg hydra`


** Stack trace/error message **
```
Traceback (most recent call last):
  File "main.py", line 576, in <module>
    main()
  File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/main.py", line 24, in decorated_main
    strict=strict,
  File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/_internal/utils.py", line 183, in run_hydra
    hydra.show_cfg(overrides=args.overrides, cfg_type=args.cfg)
  File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 116, in show_cfg
    cfg = self.compose_config(overrides, with_log_configuration=True)
TypeError: compose_config() missing 1 required positional argument: 'overrides'
```

## System information
- Hydra 0.11
- Python : 3.7

Pull request description:
Fixed --cfg not working bug
closes #304 

Patch:
diff --git a/hydra/_internal/hydra.py b/hydra/_internal/hydra.py
index 7e87b3131e..c118941e62 100644
--- a/hydra/_internal/hydra.py
+++ b/hydra/_internal/hydra.py
@@ -96,7 +96,7 @@ class Hydra:
         )
         HydraConfig().set_config(cfg)
         sweeper = Plugins.instantiate_sweeper(
-            config=cfg, config_loader=self.config_loader, task_function=task_function,
+            config=cfg, config_loader=self.config_loader, task_function=task_function
         )
         task_overrides = cfg.hydra.overrides.task
         return sweeper.sweep(arguments=task_overrides)
@@ -111,9 +111,11 @@ class Hydra:
         del cfg.hydra["help"]
         return cfg
 
-    def show_cfg(self, overrides, cfg_type):
+    def show_cfg(self, config_file, overrides, cfg_type):
         assert cfg_type in ["job", "hydra", "all"]
-        cfg = self.compose_config(overrides, with_log_configuration=True)
+        cfg = self.compose_config(
+            config_file=config_file, overrides=overrides, with_log_configuration=True
+        )
         if cfg_type == "job":
             del cfg["hydra"]
         elif cfg_type == "hydra":
diff --git a/hydra/_internal/utils.py b/hydra/_internal/utils.py
index 962a9d98e6..b80f42ac23 100644
--- a/hydra/_internal/utils.py
+++ b/hydra/_internal/utils.py
@@ -180,7 +180,9 @@ def run_hydra(args_parser, task_function, config_path, strict):
             overrides=args.overrides,
         )
     elif args.cfg:
-        hydra.show_cfg(overrides=args.overrides, cfg_type=args.cfg)
+        hydra.show_cfg(
+            config_file=config_file, overrides=args.overrides, cfg_type=args.cfg
+        )
     elif args.shell_completion:
         hydra.shell_completion(config_file=config_file, overrides=args.overrides)
     else:


Test patch:
diff --git a/tests/test_hydra.py b/tests/test_hydra.py
index 2495468565..1705e7f350 100644
--- a/tests/test_hydra.py
+++ b/tests/test_hydra.py
@@ -224,6 +224,22 @@ def test_short_module_name(tmpdir):
         chdir_hydra_root()
 
 
+@pytest.mark.parametrize(
+    "flag,expected_keys",
+    [("--cfg=all", ["db", "hydra"]), ("--cfg=hydra", ["hydra"]), ("--cfg=job", ["db"])],
+)
+def test_cfg(tmpdir, flag, expected_keys):
+    try:
+        os.chdir("examples/tutorial/4_defaults")
+        cmd = [sys.executable, "my_app.py", "hydra.run.dir=" + str(tmpdir), flag]
+        result = subprocess.check_output(cmd)
+        conf = OmegaConf.create(str(result.decode("utf-8")))
+        for key in expected_keys:
+            assert key in conf
+    finally:
+        chdir_hydra_root()
+
+
 @pytest.mark.parametrize(
     "calling_file, calling_module",
     [