aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--releaselog.py11
-rw-r--r--releaselog/__init__.py13
-rw-r--r--releaselog/format/python.py4
3 files changed, 26 insertions, 2 deletions
diff --git a/releaselog.py b/releaselog.py
index c8eeff3..c535a08 100644
--- a/releaselog.py
+++ b/releaselog.py
@@ -37,8 +37,19 @@ def main():
parser.add_option('-u', '--url',
action="store_true", dest='url',
help='treat ARG as URL')
+ parser.add_option('-l', '--list',
+ action="store_true", dest='list',
+ help="list supported formats")
(options, args) = parser.parse_args()
+ if options.list:
+ for f in ReleaseLogFile.formats():
+ if len(f) > 1:
+ print("%s; %s" % (f[0], ', '.join(f[1:])))
+ else:
+ print("%s" % f[0])
+ sys.exit(0)
+
if len(args) != 1:
parser.error("bad number of arguments")
diff --git a/releaselog/__init__.py b/releaselog/__init__.py
index 7cb9c7d..e4a04c5 100644
--- a/releaselog/__init__.py
+++ b/releaselog/__init__.py
@@ -236,6 +236,19 @@ class ReleaseLog(object):
else:
cls.formatdb[fmt] = impl
+ @classmethod
+ def formats(cls):
+ """Return a list of supported release log formats. Each item in
+ the list is a list of alternative format names.
+ """
+ rev = {}
+ for fmt in cls.formatdb:
+ if cls.formatdb[fmt] not in rev:
+ rev[cls.formatdb[fmt]] = []
+ rev[cls.formatdb[fmt]].append(fmt)
+ return rev.values()
+
+
# Initialize the ReleaseLog implementations
import pkgutil
import importlib
diff --git a/releaselog/format/python.py b/releaselog/format/python.py
index 7c2a218..bdcdea6 100644
--- a/releaselog/format/python.py
+++ b/releaselog/format/python.py
@@ -15,8 +15,8 @@ may follow.
<Version> (<Date>)
-followed by the description text. This format is used, among others, by
-GNU Texinfo.
+followed by the description text. Incidentally, this format is used by some
+non-Python software, such as e.g. GNU Texinfo.
The PythonLogFormat class discovers the actual format by finding the first
input line that matches any of the above patterns.

Return to:

Send suggestions and report system problems to the System administrator.