Skip to content

Commit 5eadf84

Browse files
committed
fix: adding missing --prepend-template
1 parent ce42e59 commit 5eadf84

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ Or from command line:
443443
since highest version, and
444444
exit.
445445
Default: disabled
446+
-pt, --prepend-template <string> Template to use when
447+
prepending. A default template
448+
will be used if not
449+
specified.
450+
<string>: any string
451+
Default: changelog-prepend.mustache
446452
-ptf, --prepend-to-file <string> Add the changelog to
447453
top of given file.
448454
<string>: any string

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
#Sun Mar 16 16:13:03 CET 2025
2+
#Mon Apr 07 16:27:41 CEST 2025
33
description="Command line tool that generates changelog from a GIT repository."
44
group=se.bjurr.gitchangelog
55
mainClass=se.bjurr.gitchangelog.main.Main
66
relocate=org\:org,com\:com
77
repoType=COMMAND
8-
version=2.5.5
8+
version=2.5.6

src/main/java/se/bjurr/gitchangelog/main/Main.java

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class Main {
4646
public static final String PARAM_OUTPUT_FILE = "-of";
4747
public static final String PARAM_OUTPUT_STDOUT = "-std";
4848
public static final String PARAM_TEMPLATE = "-t";
49+
public static final String PARAM_PREPEND_TEMPLATE = "-pt";
4950
public static final String PARAM_TEMPLATE_BASE_DIR = "-tbd";
5051
public static final String PARAM_TEMPLATE_PARTIAL_SUFFIX = "-tps";
5152
public static final String PARAM_REPO = "-r";
@@ -120,6 +121,13 @@ public static void main(final String args[]) throws Exception {
120121
.defaultValue(defaultSettings.getTemplatePath()) //
121122
.build();
122123

124+
final Argument<String> prependTemplatePathArgument =
125+
stringArgument(PARAM_PREPEND_TEMPLATE, "--prepend-template") //
126+
.description(
127+
"Template to use when prepending. A default template will be used if not specified.") //
128+
.defaultValue(defaultSettings.getPrependTemplatePath()) //
129+
.build();
130+
123131
final Argument<String> templateBaseDirArgument =
124132
stringArgument(PARAM_TEMPLATE_BASE_DIR, "--template-base-dir") //
125133
.description("Base dir of templates.") //
@@ -503,6 +511,7 @@ public static void main(final String args[]) throws Exception {
503511
outputStdoutArgument,
504512
outputFileArgument,
505513
templatePathArgument,
514+
prependTemplatePathArgument,
506515
templateBaseDirArgument,
507516
templatePartialSuffixArgument,
508517
fromCommitArgument,
@@ -659,6 +668,9 @@ public static void main(final String args[]) throws Exception {
659668
if (arg.wasGiven(templatePathArgument)) {
660669
changelogApiBuilder.withTemplatePath(arg.get(templatePathArgument));
661670
}
671+
if (arg.wasGiven(prependTemplatePathArgument)) {
672+
changelogApiBuilder.withPrependTemplatePath(arg.get(prependTemplatePathArgument));
673+
}
662674
if (arg.wasGiven(jiraIssuePatternArgument)) {
663675
changelogApiBuilder.withJiraIssuePattern(arg.get(jiraIssuePatternArgument));
664676
}

0 commit comments

Comments
 (0)