Add -N/--maintainer-name & -E/--maintainer-email parameters
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Benjamin Renard 2022-04-30 22:22:25 +02:00
parent ce9181f53f
commit 812d4a051a

24
gitdch
View file

@ -109,6 +109,22 @@ parser.add_argument(
default=DEFAULT_URGENCY
)
parser.add_argument(
'-N',
'--maintainer-name',
type=str,
dest='maintainer_name',
help='Maintainer name (default: last commit author name)'
)
parser.add_argument(
'-E',
'--maintainer-email',
type=str,
dest='maintainer_email',
help='Maintainer email (default: last commit author email)'
)
options = parser.parse_args()
if not options.package_name:
@ -219,8 +235,12 @@ for version in versions:
changelog_lines.append(
"\n -- {name} <{email}> {date}\n\n".format(
name=version['commit'].author.name,
email=version['commit'].author.email,
name=(
options.maintainer_name if options.maintainer_name
else version['commit'].author.name),
email=(
options.maintainer_email if options.maintainer_email
else version['commit'].author.email),
date=version['commit'].committed_datetime.strftime(
"%a, %d %b %Y %H:%M:%S %z")
)