Repository: JetBrains/compose-multiplatform
File: tools/changelog.main.kts (Kotlin)

Code before:
    "Web",
    "Android",
    "Resources",
    "Gradle Plugin",
    "Lifecycle",
    "Navigation",
)

val changelogFile = __FILE__.resolve("../../CHANGELOG.md").canonicalFile

//endregion

val argsKeyless = args
    .filter { !it.contains("=") }

val argsKeyToValue = args
    .filter { it.contains("=") }
    .associate { it.substringBefore("=") to it.substringAfter("=") }

val commitsArg = argsKeyless.getOrNull(0) ?: "HEAD"

var previousVersionCommitArg: String?
var versionCommitArg: String
if (commitsArg.contains("..")) {
    previousVersionCommitArg = commitsArg.substringBefore("..")
    versionCommitArg = commitsArg.substringAfter("..",)
} else {
    previousVersionCommitArg = null
    versionCommitArg = commitsArg
}

val versionCommit = versionCommitArg

val token = argsKeyToValue["token"]

println("Note. The script supports optional arguments: kotlin changelog.main.kts [previousVersionCommit..versionCommit] [token=githubToken]")
if (token == null) {
    println("To increase the rate limit, specify token (https://github.com/settings/tokens)")
}
println()

val androidxLibToPreviousVersion = previousVersionCommitArg?.let(::androidxLibToVersion)
val androidxLibToVersion = androidxLibToVersion(versionCommit)
val androidxLibToRedirectingVersion = androidxLibToRedirectingVersion(versionCommit)

fun formatAndroidxLibVersion(libName: String) =
    androidxLibToVersion[libName] ?: "PLACEHOLDER".also {
        println("Can't find $libName version. Using PLACEHOLDER")
    }

fun formatAndroidxLibRedirectingVersion(libName: String) =

Review comment (suggestion):
That comma looks strange here. Is it working?
```suggestion
    versionCommitArg = commitsArg.substringAfter("..")
```

Code after:
    "Web",
    "Android",
    "Resources",
    "Gradle Plugin",
    "Lifecycle",
    "Navigation",
)

val changelogFile = __FILE__.resolve("../../CHANGELOG.md").canonicalFile

//endregion

val argsKeyless = args
    .filter { !it.contains("=") }

val argsKeyToValue = args
    .filter { it.contains("=") }
    .associate { it.substringBefore("=") to it.substringAfter("=") }

val commitsArg = argsKeyless.getOrNull(0) ?: "HEAD"

var previousVersionCommitArg: String?
var versionCommitArg: String
if (commitsArg.contains("..")) {
    previousVersionCommitArg = commitsArg.substringBefore("..")
    versionCommitArg = commitsArg.substringAfter("..")
} else {
    previousVersionCommitArg = null
    versionCommitArg = commitsArg
}

val versionCommit = versionCommitArg

val token = argsKeyToValue["token"]

println("Note. The script supports optional arguments: kotlin changelog.main.kts [previousVersionCommit..versionCommit] [token=githubToken]")
if (token == null) {
    println("To increase the rate limit, specify token (https://github.com/settings/tokens)")
}
println()

val androidxLibToPreviousVersion = previousVersionCommitArg?.let(::androidxLibToVersion)
val androidxLibToVersion = androidxLibToVersion(versionCommit)
val androidxLibToRedirectingVersion = androidxLibToRedirectingVersion(versionCommit)

fun formatAndroidxLibPreviousVersion(libName: String) =
    androidxLibToPreviousVersion?.get(libName) ?: "PLACEHOLDER".also {
        println("Can't find $libName previous version. Using PLACEHOLDER")
    }

fun formatAndroidxLibVersion(libName: String) =