# ~ If the program is called with '-h' option, it fails due to %Y in the # ~ help message of the --from argument, producing this error: # ~ File "/usr/lib/python3.8/argparse.py", line 633, in _expand_help # ~ return self._get_help_string(action) % params # ~ ValueError: unsupported format character 'Y' (0x59) at index 18 import argparse parser = argparse.ArgumentParser( description = 'Plots the standby data.' ) parser.add_argument( '--from', metavar = 'when', help = 'A date in format %Y-%m-%d', dest = f'From', type = str, required = True, ) args = parser.parse_args() print(args.From)