import re
args = '-t 500 -x -c 3 -d --long-option 456 -testing weird-behaviour'
matches = re.findall('(--?[\\w-]+)(.*?)(?= -|$)', args)
result = {}
for match in matches:
    result[match[0]] = True if not match[1] else match[1].strip()
print(result)
How to parse an arbitrary option string into a python dictionary