scripts: fix logic error in argv wrapping code

The first piece of the command we process must be added to the list
straight away regardless of whether it starts with a '-' or not.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-09-17 12:49:12 +01:00
parent f253dc90f5
commit 2a1b0e51dd

View File

@ -59,7 +59,7 @@ def rewrap_line(line):
# If there's a leading '-' then this is a new
# parameter, otherwise its a value for the prev
# parameter.
if bit.startswith("-"):
if bit.startswith("-") or len(args) == 0:
args.append(bit)
else:
args[-1] = args[-1] + " " + bit