1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 09:46:19 +02:00

Bring the '--debug' option back to the 'buildinfo' command

It was automatically removed by the argument parser when resolving
a conflict between buildinfo's --debug and the global --debug option.
Now we're iterating backwards to give the command's options
a priority over parent/global options.
This commit is contained in:
Daniel Mach 2023-04-11 17:08:45 +02:00
parent fcc4b9cc7e
commit 53e204f275

View File

@ -84,10 +84,14 @@ class Command:
) )
# traverse the parent commands and add their options to the current command # traverse the parent commands and add their options to the current command
commands = []
cmd = self cmd = self
while cmd: while cmd:
cmd.init_arguments() commands.append(cmd)
cmd = cmd.parent cmd = cmd.parent
# iterating backwards to give the command's options a priority over parent/global options
for cmd in reversed(commands):
cmd.init_arguments()
def __repr__(self): def __repr__(self):
return f"<osc plugin {self.full_name} at {self.__hash__():#x}>" return f"<osc plugin {self.full_name} at {self.__hash__():#x}>"