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 <gentoo-commits+bounces-391358-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RDh4e-0001iF-9O
	for garchives@archives.gentoo.org; Tue, 11 Oct 2011 18:29:08 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9016E21C0A4;
	Tue, 11 Oct 2011 18:28:58 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 5DDB121C0A4
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Oct 2011 18:28:58 +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 D12331B4006
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Oct 2011 18:28:57 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 346B680042
	for <gentoo-commits@lists.gentoo.org>; Tue, 11 Oct 2011 18:28:57 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <601f819deef7da3af2101ce9e85cb8804355dffa.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/ebuild
X-VCS-Directories: bin/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 601f819deef7da3af2101ce9e85cb8804355dffa
Date: Tue, 11 Oct 2011 18:28:57 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: 9e2d0e27be85e327256e07036fbbc17b

commit:     601f819deef7da3af2101ce9e85cb8804355dffa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 11 18:28:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 11 18:28:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D601f819d

bin/ebuild: add --version option

---
 bin/ebuild |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/bin/ebuild b/bin/ebuild
index 1cbdb2d..d4b8b71 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -46,6 +46,8 @@ parser.add_option("--color", help=3D"enable or disable =
color output",
 	type=3D"choice", choices=3D("y", "n"))
 parser.add_option("--debug", help=3D"show debug output",
 	action=3D"store_true", dest=3D"debug")
+parser.add_option("--version", help=3D"show version and exit",
+	action=3D"store_true", dest=3D"version")
 parser.add_option("--ignore-default-opts",
 	action=3D"store_true",
 	help=3D"do not use the EBUILD_DEFAULT_OPTS environment variable")
@@ -54,9 +56,6 @@ parser.add_option("--skip-manifest", help=3D"skip all m=
anifest checks",
=20
 opts, pargs =3D parser.parse_args(args=3Dsys.argv[1:])
=20
-if len(pargs) < 2:
-	parser.error("missing required args")
-
 os.environ["PORTAGE_CALLER"]=3D"ebuild"
 try:
 	import portage
@@ -75,6 +74,13 @@ from portage.const import VDB_PATH
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
=20
+if opts.version:
+	print("Portage", portage.VERSION)
+	sys.exit(os.EX_OK)
+
+if len(pargs) < 2:
+	parser.error("missing required args")
+
 if not opts.ignore_default_opts:
 	default_opts =3D portage.settings.get("EBUILD_DEFAULT_OPTS", "").split(=
)
 	opts, pargs =3D parser.parse_args(default_opts + sys.argv[1:])