diff options
| author | Barry Warsaw | 2009-04-01 15:14:24 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-04-01 15:14:24 -0500 |
| commit | 9ff1079e0efc68fc64b91c6d0728f933df84abc7 (patch) | |
| tree | 0a603521d2a859854d6f0b41e9e0dcbcccccad35 /src/mailman/bin/version.py | |
| parent | b4d87c122b372e7805d9bbc712ccffea46c18d75 (diff) | |
| download | mailman-9ff1079e0efc68fc64b91c6d0728f933df84abc7.tar.gz mailman-9ff1079e0efc68fc64b91c6d0728f933df84abc7.tar.zst mailman-9ff1079e0efc68fc64b91c6d0728f933df84abc7.zip | |
Diffstat (limited to 'src/mailman/bin/version.py')
| -rw-r--r-- | src/mailman/bin/version.py | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/mailman/bin/version.py b/src/mailman/bin/version.py index 0fb2c5a5b..af888f0f6 100644 --- a/src/mailman/bin/version.py +++ b/src/mailman/bin/version.py @@ -15,32 +15,31 @@ # You should have received a copy of the GNU General Public License along with # GNU Mailman. If not, see <http://www.gnu.org/licenses/>. -import optparse +"""Print the Mailman version.""" -from mailman import version +from __future__ import absolute_import, unicode_literals + +__metaclass__ = type +__all__ = [ + 'main', + ] + + +from mailman.core.system import system from mailman.i18n import _ +from mailman.options import Options -def parseargs(): - parser = optparse.OptionParser(version=version.MAILMAN_VERSION, - usage=_("""\ +class ScriptOptions(Options): + usage = _("""\ %prog -Print the Mailman version and exit.""")) - opts, args = parser.parse_args() - if args: - parser.error(_('Unexpected arguments')) - return parser, opts, args +Print the Mailman version and exit.""") def main(): - parser, opts, args = parseargs() - # Yes, this is kind of silly - print _('Using $version.MAILMAN_VERSION ($version.CODENAME)') - - - -if __name__ == '__main__': - main() + options = ScriptOptions() + options.initialize() + print _('Using $system.mailman_version') |
