From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QsBUm-0001Ng-9O for garchives@archives.gentoo.org; Sat, 13 Aug 2011 10:31:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D790421C1B9; Sat, 13 Aug 2011 10:31:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A7A0821C1B9 for ; Sat, 13 Aug 2011 10:31:04 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 239A51B4024 for ; Sat, 13 Aug 2011 10:31:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0825C80048 for ; Sat, 13 Aug 2011 10:31:02 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/querycli.py X-VCS-Directories: gentoopm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: dcbd4501a78d6c4daa64ea037926e092ca65e6fd Date: Sat, 13 Aug 2011 10:31:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: b25405e35d15613b17b89b9529f687cb commit: dcbd4501a78d6c4daa64ea037926e092ca65e6fd Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sat Aug 13 10:30:23 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sat Aug 13 10:30:23 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3Ddcbd4501 gentoopmq: support --version. --- gentoopm/querycli.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/gentoopm/querycli.py b/gentoopm/querycli.py index af4f6c0..9c773cf 100644 --- a/gentoopm/querycli.py +++ b/gentoopm/querycli.py @@ -6,7 +6,7 @@ import argparse, os.path from abc import abstractmethod =20 -from . import get_package_manager +from . import PV, get_package_manager from .util import ABCObject =20 def _reponame(val): @@ -145,6 +145,9 @@ class PMQueryCLI(object): def __init__(self): self.argparser =3D arg =3D argparse.ArgumentParser() =20 + arg.add_argument('-V', '--version', + action=3D'version', version=3D'%s %s' % (arg.prog, PV)) + subp =3D arg.add_subparsers(title =3D 'Sub-commands') for cmd_name, cmd_help, cmd_class in PMQueryCommands(): p =3D subp.add_parser(cmd_name, help=3Dcmd_help)