forked from dunossauro/live-de-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestes.py
More file actions
executable file
·26 lines (22 loc) · 962 Bytes
/
Copy pathtestes.py
File metadata and controls
executable file
·26 lines (22 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from argparse import ArgumentParser
parser = ArgumentParser(prog='ShellTests',
usage='ShellTests [arg]',
description='''\n
Para usar isso, faça isso''',
epilog='Entendeu???',
fromfile_prefix_chars='@')
# parser.add_argument('y')
# parser.add_argument('x')
parser.add_argument('-foo', '-f', '--foo', type=float,
action='append', dest='xpto')
parser.add_argument('-s', const=str,
action='append_const', dest='xpto')
parser.add_argument('-i', const=int,
action='append_const', dest='xpto')
parser.add_argument('-v', action='count', default=0)
parser.add_argument('-xpto2', '-x', default=0, type=int,
choices=[1, 2, 3], required=True,
help='xpto, a arte pythonica', metavar='XPTO')
parser.print_help()
args = parser.parse_args()
print(args)