diff options
author | Brian Harring <ferringb@gentoo.org> | 2006-01-08 12:41:08 +0000 |
---|---|---|
committer | Brian Harring <ferringb@gentoo.org> | 2006-01-08 12:41:08 +0000 |
commit | 21e48b20c77048177342b1a368a44d732b5f13aa (patch) | |
tree | 2504007c6e73a714086f0692566beb1461d19b5b | |
parent | 31122c42fa0031dd7ffeae855b75b9e3805e6698 (diff) | |
download | portage-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-x | bin/portageq | 13 |
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] +"'" |