Mercurial > hg > fail
comparison fail.py @ 1:a4680e54c481
fix formatting
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 23 Aug 2016 13:57:20 -0700 |
parents | 02d077c5627a |
children | d1880117acb5 |
comparison
equal
deleted
inserted
replaced
0:02d077c5627a | 1:a4680e54c481 |
---|---|
8 import argparse | 8 import argparse |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 import time | 11 import time |
12 | 12 |
13 | |
13 def main(args=sys.argv[1:]): | 14 def main(args=sys.argv[1:]): |
14 """CLI""" | 15 """CLI""" |
15 | 16 |
16 # parse command line | 17 # parse command line |
17 parser = argparse.ArgumentParser(description=__doc__) | 18 parser = argparse.ArgumentParser(description=__doc__) |
18 parser.add_argument('command', help="command to run") | 19 parser.add_argument('command', help="command to run") |
19 parser.add_argument('--code', dest='codes', default=(0,), nargs='+', | 20 parser.add_argument('--code', dest='codes', default=(0,), nargs='+', |
20 help="allowed exit codes") | 21 help="allowed exit codes") |
21 parser.add_argument('-s', '--sleep', dest='sleep', | 22 parser.add_argument('-s', '--sleep', dest='sleep', |
22 type=float, default=1., | 23 type=float, default=1., |
23 help="sleep between iterations [DEFAULT: %(default)]") | 24 help="sleep between iterations [DEFAULT: %(default)s]") |
24 options = parser.parse_args(args) | 25 options = parser.parse_args(args) |
25 | 26 |
26 try: | 27 try: |
27 | 28 |
28 ctr = 0 | 29 ctr = 0 |