summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gentoo.org>2006-01-08 12:41:08 +0000
committerBrian Harring <ferringb@gentoo.org>2006-01-08 12:41:08 +0000
commit21e48b20c77048177342b1a368a44d732b5f13aa (patch)
tree2504007c6e73a714086f0692566beb1461d19b5b
parent31122c42fa0031dd7ffeae855b75b9e3805e6698 (diff)
downloadportage-21e48b20c77048177342b1a368a44d732b5f13aa.tar.gz
portage-21e48b20c77048177342b1a368a44d732b5f13aa.tar.bz2
portage-21e48b20c77048177342b1a368a44d732b5f13aa.zip
bug 118191 , puke properly when no args to envvar are supplied.
svn path=/main/trunk/; revision=2550
-rwxr-xr-xbin/portageq13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/portageq b/bin/portageq
index 628f292cc..bbf001901 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -203,11 +203,14 @@ def envvar(argv):
Returns a specific environment variable as exists prior to ebuild.sh.
Similar to: emerge --verbose --info | egrep '^<variable>='
"""
- if (argv[0] == "-v"):
- verbose=1
- argv=argv[1:]
- else:
- verbose=0
+ verbose = "-v" in argv
+ if verbose:
+ argv.pop(argv.index("-v"))
+
+ if len(argv) == 0:
+ print "ERROR: insufficient parameters!"
+ sys.exit(2)
+
for arg in argv:
if verbose:
print arg +"='"+ portage.settings[arg] +"'"