using argparse i have made a command line tool, which takes below arguments,
usage: ipush [-h] [-v] [-c] [-to [TO]] [-V] [-p PATCHES] [-d DIFF]
from the below code..
parser = argparse.ArgumentParser(prog='ipush',
description='Utility to push the last commit and email the color diff')
parser.add_argument('-v', '--verbose', action='store_true',
help='if enabled will spit every command and its resulting data.')
parser.add_argument('-c', '--compose', action='store_true',
help='compose message in default git editor to be sent prefixed with diff')
parser.add_argument('-to', type=validate_address, default=os.getenv('myemail'),
help='enter a valid email you want to send to.', nargs='?')
parser.add_argument('-V', '--version', action='version',
version='%(prog)s 1.0')
parser.add_argument('-p', '--patches', type=int, default=0,
help='total number of pathces of last commits to email')
parser.add_argument('-d', '--diff', required=False, default='HEAD^ HEAD',
help='if present pass arguments to it as you \
will do to git diff in inverted commas')
is it possible to display TO in [-to [TO]]
PATCHES in [-p PATCHES]
and DIFF in [-d DIFF]
with a different text?