From: Brian Harring Date: Sun, 8 Jan 2006 12:41:08 +0000 (-0000) Subject: bug 118191 , puke properly when no args to envvar are supplied. X-Git-Tag: v2.1_pre4~42 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=21e48b20c77048177342b1a368a44d732b5f13aa;p=portage.git bug 118191 , puke properly when no args to envvar are supplied. svn path=/main/trunk/; revision=2550 --- 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 '^=' """ - 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] +"'"