example: Fix argument handling

sys.argv contains the original command line arguments, while args only
contains the arguments not handled by getopt(). Currently this is no
problem since --help is the only command line option passable, which
terminates the process, so the code is never reached. Any option added
in the future will reveal the bug.

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn 2011-10-12 16:54:40 +02:00 committed by Eric Blake
parent 5cf56c4b23
commit 08d56e24b0

View File

@ -486,8 +486,8 @@ def main():
usage()
sys.exit()
if len(sys.argv) > 1:
uri = sys.argv[1]
if len(args) >= 1:
uri = args[0]
else:
uri = "qemu:///system"