Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _format_action_invocation(self, action):
"""
Reformat multiple metavar output
-d , --device , --host
to single output
-d, --device, --host
"""
orgstr = configargparse.HelpFormatter._format_action_invocation(self, action)
if orgstr and orgstr[0] != '-': # only optional arguments
return orgstr
res = getattr(action, '_formatted_action_invocation', None)
if res:
return res
options = orgstr.split(', ')
if len(options) <=1:
action._formatted_action_invocation = orgstr
return orgstr
return_list = []
for option in options:
meta = ""
arg = option.split(' ')
if len(arg)>1: