summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2009-11-03 23:24:06 -0500
committerBarry Warsaw2009-11-03 23:24:06 -0500
commit0bcd0713c35cc81a7f5d824bbe8df83df3b065ed (patch)
treed5301964122169390a632ee87ac182fc765f8b9e
parent4b1c4b3552c1badca343d071ea11cd7462d2244a (diff)
downloadmailman-0bcd0713c35cc81a7f5d824bbe8df83df3b065ed.tar.gz
mailman-0bcd0713c35cc81a7f5d824bbe8df83df3b065ed.tar.zst
mailman-0bcd0713c35cc81a7f5d824bbe8df83df3b065ed.zip
-rw-r--r--src/mailman/commands/cli_info.py1
-rw-r--r--src/mailman/commands/cli_version.py49
-rw-r--r--src/mailman/commands/docs/version.txt11
3 files changed, 60 insertions, 1 deletions
diff --git a/src/mailman/commands/cli_info.py b/src/mailman/commands/cli_info.py
index a710e3bd7..b5a0e8e5d 100644
--- a/src/mailman/commands/cli_info.py
+++ b/src/mailman/commands/cli_info.py
@@ -53,7 +53,6 @@ class Info:
def process(self, args):
"""See `ICLISubCommand`."""
-
if args.output is None:
output = sys.stdout
else:
diff --git a/src/mailman/commands/cli_version.py b/src/mailman/commands/cli_version.py
new file mode 100644
index 000000000..4d4ca9e96
--- /dev/null
+++ b/src/mailman/commands/cli_version.py
@@ -0,0 +1,49 @@
+# Copyright (C) 2009 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
+
+"""The Mailman version."""
+
+from __future__ import absolute_import, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+ 'Version',
+ ]
+
+
+from zope.interface import implements
+
+from mailman.interfaces.command import ICLISubCommand
+from mailman.version import MAILMAN_VERSION_FULL
+
+
+
+class Version:
+ """Mailman's version."""
+
+ implements(ICLISubCommand)
+
+ name = 'version'
+
+ def add(self, parser, command_parser):
+ """See `ICLISubCommand`."""
+ # No extra options.
+ pass
+
+ def process(self, args):
+ """See `ICLISubCommand`."""
+ print MAILMAN_VERSION_FULL
diff --git a/src/mailman/commands/docs/version.txt b/src/mailman/commands/docs/version.txt
new file mode 100644
index 000000000..9987066e9
--- /dev/null
+++ b/src/mailman/commands/docs/version.txt
@@ -0,0 +1,11 @@
+====================
+Printing the version
+====================
+
+You can print the Mailman version number.
+
+ >>> from mailman.commands.cli_version import Version
+ >>> command = Version()
+
+ >>> command.process(None)
+ GNU Mailman 3...