Python Tip #120 (of 365):
Optimize for CLI user experience, not just developer experience
By default in argparse, the names that end users see for arguments are coupled to the attribute names that you as a Python script maintainer see.
Decouple them when needed.
You can control the argument names that a user sees with metavar:
This uses the attribute args.path but show users FILENAME in help text:
parser.add_argument("path", type=Path, metavar="FILENAME")
🧵 (1/2)