Skip to content

Commit

Permalink
document custom regex CLI argument for version line and semver line i…
Browse files Browse the repository at this point in the history
…n README
  • Loading branch information
brainelectronics committed Aug 3, 2022
1 parent cb28079 commit 095bec4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ changelog2version \
--debug
```

## Advanced

### Custom regular expressions
To extract a version line from a given changelog file with an alternative
regex, the `version_line_regex` argument can be used as shown below. The
expression is validated during the CLI argument parsing

```bash
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_line_regex "^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\]" \
--debug
```

Same applies for a custom semver line regex in order to extract the semantic
version part from a full version line, use the `semver_line_regex` argument to
adjust the regular expression to your needs.

## Credits

Based on the [PyPa sample project][ref-pypa-sample].
Expand Down

0 comments on commit 095bec4

Please sign in to comment.