summaryrefslogtreecommitdiff
path: root/gnulib-tool.py
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-05 14:17:35 +0200
committerBruno Haible <bruno@clisp.org>2022-08-05 15:06:26 +0200
commit1f0e03e5a3e83d271c4aef05dbbb4850f66cee42 (patch)
tree772214cef1f70228283c2781b9cf08f3efe7d81d /gnulib-tool.py
parent276725c4e2c8e06e3cec36472adb0be7d99b709d (diff)
downloadgnulib-1f0e03e5a3e83d271c4aef05dbbb4850f66cee42.tar.gz
gnulib-tool.py: Make option --version work.
* pygnulib/constants.py (__copyright__): Bump copyright year. * pygnulib/GLInfo.py (GLInfo.authors): Add a comma after the second-to-last author. (GLInfo.copyright): Show only the last modification year. (GLInfo.date): Check whether git and GNU date are available. Use 'git log ChangeLog', not 'git log'. Run 'git log' in the gnulib directory, not in the current directory. Search for 'Date:' only at the beginning of a line. As a fallback, look at the first ChangeLog entry. (GLInfo.version): Check whether git is available. Run git-version-gen in the gnulib directory, not in the current directory. Replace '-dirty' with '-modified'. As a fallback, return the empty string. * gnulib-tool.py (main) [--version]: Add a space before the version.
Diffstat (limited to 'gnulib-tool.py')
-rwxr-xr-xgnulib-tool.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnulib-tool.py b/gnulib-tool.py
index 1a6bd9e948..c4386133a6 100755
--- a/gnulib-tool.py
+++ b/gnulib-tool.py
@@ -397,8 +397,11 @@ def main():
print(info.usage())
sys.exit(0)
if cmdargs.version != None:
+ version = info.version()
+ if version != '':
+ version = ' ' + version
message = '''gnulib-tool (%s %s)%s\n%s\n%s\n\nWritten by %s.''' \
- % (info.package(), info.date(), info.version(), info.copyright(),
+ % (info.package(), info.date(), version, info.copyright(),
info.license(), info.authors())
print(message)
sys.exit(0)