Commits

Michał Górny committed dcbd450

gentoopmq: support --version.

Comments (0)

Files changed (1)

gentoopm/querycli.py

 import argparse, os.path
 from abc import abstractmethod
 
-from . import get_package_manager
+from . import PV, get_package_manager
 from .util import ABCObject
 
 def _reponame(val):
 	def __init__(self):
 		self.argparser = arg = argparse.ArgumentParser()
 
+		arg.add_argument('-V', '--version',
+			action='version', version='%s %s' % (arg.prog, PV))
+
 		subp = arg.add_subparsers(title = 'Sub-commands')
 		for cmd_name, cmd_help, cmd_class in PMQueryCommands():
 			p = subp.add_parser(cmd_name, help=cmd_help)