Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Short names

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--color', '-c', help='The name of the color')
parser.add_argument('--verbose', '-v', help='Print more data',
    action='store_true')
args = parser.parse_args()

print(args.color)
print(args.verbose)

python argparse_shortname.py -c Blue -v
python argparse_shortname.py -vc Blue