summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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] +"'"