Repository: mc706/changelog-cli

Issue:
The --yes flag on release results in a release type flag being ignored
It seems that using the `--yes` flag with release causes the recommended release type to be used rather than one specified by the command. See examples below.

It looks like a simple fix - will hopefully raise a PR as soon as I can get my head around how the tests work!

```
$ changelog suggest
0.7.1

$ changelog release --patch
Planning on releasing version 0.7.1. Proceed? [y/N]: N

$ changelog release --minor
Planning on releasing version 0.8.0. Proceed? [y/N]: N

$ changelog release --major
Planning on releasing version 1.0.0. Proceed? [y/N]: N

$ changelog release --major --yes

$ changelog current
0.7.1
```


Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a4a3db0..eec5d1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
   * Existing CHANGELOGs will start using these headers after the new run of `changelog release`
 
 ### Fixed
+* Fix changelog release --<release type> --yes
 * Format release lines in the same format that keepachangelog.com does
 * Fix Description for pypi
 
diff --git a/src/changelog/commands.py b/src/changelog/commands.py
index d038747..7b29803 100644
--- a/src/changelog/commands.py
+++ b/src/changelog/commands.py
@@ -60,7 +60,7 @@ def release(release_type: str, auto_confirm: bool) -> None:
     try:
         new_version = CL.get_new_release_version(release_type)
         if auto_confirm:
-            CL.cut_release()
+            CL.cut_release(release_type)
         else:
             if click.confirm(f"Planning on releasing version {new_version}. Proceed?"):
                 CL.cut_release(release_type)


Test patch:
diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py
index 9c3e472..9de770d 100644
--- a/tests/integration/test_cli.py
+++ b/tests/integration/test_cli.py
@@ -128,6 +128,15 @@ class CliIntegrationTestCase(unittest.TestCase):
             suggest = self.runner.invoke(cli, ['current'])
             self.assertEqual(suggest.output.strip(), '0.1.0')
 
+    def test_cli_release_y_specify_type(self):
+        with self.runner.isolated_filesystem():
+            self.runner.invoke(cli, ['init'])
+            self.runner.invoke(cli, ['added', 'Adding a new feature'])
+            result = self.runner.invoke(cli, ['release', '--major', '--yes'])
+            self.assertTrue(result)
+            suggest = self.runner.invoke(cli, ['current'])
+            self.assertEqual(suggest.output.strip(), '1.0.0')
+
     def test_cli_release_missing(self):
         with self.runner.isolated_filesystem():
             result = self.runner.invoke(cli, ['release'])