Skip to content

Commit 61d2293

Browse files
committed
fix: add back --format=x arg option
1 parent 3eba266 commit 61d2293

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@ npm i changelog-maker -g
4848

4949
`github-user` and `github-project` should point to the GitHub repository that can be used to find the `PR-URL` data if just an issue number is provided and will also impact how the PR-URL issue numbers are displayed
5050

51-
* `--plaintext`: print a very simple form, without commit details, implies `--group`
52-
* `--markdown`: print a Markdown formatted from, with links and proper escaping
53-
* `--sha`: print only the list of short-form commit hashes
51+
* `--format`: dictates what formatting the output will have. Possible options are: `simple`, `markdown`, `plaintext`, and `sha`. The default is to print a `simple` output suitable for stdout.
52+
- `simple`: don't print full markdown output, good for console printing without the additional fluff.
53+
- `sha`: print only the 10-character truncated commit hashes.
54+
- `plaintext`: a very simple form, without commit details, implies `--group`.
55+
- `markdown`: a Markdown formatted from, with links and proper escaping.
56+
* `--sha`: same as `--format=sha`.
57+
* `--plaintext`: same as `--format=plaintext`.
58+
* `--markdown`: same as `--format=markdown`.
5459
* `--group`: reorder commits so that they are listed in groups where the `xyz:` prefix of the commit message defines the group. Commits are listed in original order _within_ group.
5560
* `--reverse`: reverse the order of commits when printed, does not work with `--reverse`
5661
* `--commit-url`: pass in a url template which will be used to generate commit URLs for a repository not hosted in Github. `{ref}` is the placeholder that will be replaced with the commit, i.e. `--commit-url=https://gitlab.com/myUser/myRepo/commit/{ref}`

process-commits.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { supportsColor } from 'chalk'
77
import { collectCommitLabels } from './collect-commit-labels.js'
88

99
function getFormat (argv) {
10-
if (argv.sha) {
10+
if (argv.format && Object.values(formatType).includes(argv.format)) {
11+
return argv.format
12+
} else if (argv.sha) {
1113
return formatType.SHA
1214
} else if (argv.plaintext || argv.p) {
1315
return formatType.PLAINTEXT

0 commit comments

Comments
 (0)