mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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:
parent
5cf56c4b23
commit
08d56e24b0
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user