-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathls-cycles
executable file
·23 lines (19 loc) · 957 Bytes
/
ls-cycles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
#
from argparse import ArgumentParser, RawTextHelpFormatter
from lib.bug import BugHelper
if __name__ == '__main__':
app_description = '''List all of the SRU cycles known about in the database.
'''
app_epilog = '''
Examples:
./ls-cycles --stable | tail -n 1
This should tell you what the current cycle is.
'''
parser = ArgumentParser(description=app_description, epilog=app_epilog, formatter_class=RawTextHelpFormatter)
parser.add_argument('--stable', action='store_true', default=False, help='Stable cycles only')
parser.add_argument('--dev', action='store_true', default=False, help='Development cycles only')
args = parser.parse_args()
q = 'select distinct cycle from bugs where cycle is not null and cycle != \'None\' and cycle <> \'\' order by cycle;'
for r in BugHelper().query(q):
print("%s" % r['cycle'])