Skip to content

Commit

Permalink
Rename the getChangelog CLI option from --version=.. to `--projec…
Browse files Browse the repository at this point in the history
…t-version=..` #188
  • Loading branch information
hsz committed Aug 28, 2023
1 parent 09982b0 commit d386fc0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

## [Unreleased]

### Changed
- Rename the `getChangelog` CLI option from `--version=..` to `--project-version=..` [#188](../../issues/188)

## [2.1.2] - 2023-07-10

### Fixed
- Changelog render is inconsistent between different line separators [#182](../../issues/182)
- Changelog render is inconsistent between different line separators [#182](../../issues/182)

### Changed
- Use `GITHUB_OUTPUT` environment file instead of deprecated `::set-output` command in GitHub Actions
- Use `GITHUB_OUTPUT` environment file instead of deprecated `::set-output` command in GitHub Actions
- Deprecate `itemPrefix` and `lineSeparator` properties in the `org.jetbrains.changelog.Changelog.Item` constructor [#181](../../issues/181)

## [2.1.1] - 2023-07-07
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ Retrieves changelog for the specified version.

#### Options

| Option | Type | Default value | Description |
|-----------------------|-----------|---------------|----------------------------------------------------|
| `--no-header` | `Boolean` | `false` | Omits the section header in the changelog output. |
| `--no-summary` | `Boolean` | `false` | Omits the section summary in the changelog output. |
| `--no-links` | `Boolean` | `false` | Omits links in the changelog output. |
| `--no-empty-sections` | `Boolean` | `false` | Omits empty sections in the changelog output. |
| `--version` | `String?` | `null` | Returns change notes for the specified version. |
| `--unreleased` | `Boolean` | `false` | Returns change notes for an unreleased section. |
| Option | Type | Default value | Description |
|-----------------------|-----------|---------------|---------------------------------------------------------|
| `--no-header` | `Boolean` | `false` | Omits the section header in the changelog output. |
| `--no-summary` | `Boolean` | `false` | Omits the section summary in the changelog output. |
| `--no-links` | `Boolean` | `false` | Omits links in the changelog output. |
| `--no-empty-sections` | `Boolean` | `false` | Omits empty sections in the changelog output. |
| `--project-version` | `String?` | `null` | Returns change notes for the specified project version. |
| `--unreleased` | `Boolean` | `false` | Returns change notes for an unreleased section. |

#### Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ abstract class GetChangelogTask : BaseChangelogTask() {
@get:Input
@get:Optional
@Option(
option = "version",
description = "Returns change notes for the specified version.",
option = "project-version",
description = "Returns change notes for the specified project version.",
)
var cliVersion = null as String?
var projectVersion = null as String?

/**
* Returns change notes for an unreleased section.
Expand All @@ -102,7 +102,7 @@ abstract class GetChangelogTask : BaseChangelogTask() {
@TaskAction
fun run() = logger.quiet(
with(changelog.get()) {
val version = cliVersion
val version = projectVersion

when {
version != null -> get(version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class GetChangelogTaskTest : BaseTest() {

@Test
fun `returns change notes for the version specified with CLI`() {
val result = runTask(GET_CHANGELOG_TASK_NAME, "--quiet", "--version=1.0.1")
val result = runTask(GET_CHANGELOG_TASK_NAME, "--quiet", "--project-version=1.0.1")

assertMarkdown(
"""
Expand Down

0 comments on commit d386fc0

Please sign in to comment.