mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
list-fixed-bugs: use argparse for the commandline
This makes the interface more friendly to users.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2015-12-29 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* scripts/list-fixed-bugs.py: Import argparse. Call main instead.
|
||||||
|
(get_parser): New function.
|
||||||
|
(main): New function.
|
||||||
|
|
||||||
2015-12-29 Rob Wu <rob@robwu.nl>
|
2015-12-29 Rob Wu <rob@robwu.nl>
|
||||||
|
|
||||||
[BZ #19369]
|
[BZ #19369]
|
||||||
|
@ -23,11 +23,21 @@ bugs marked as FIXED with that milestone, to be added to the NEWS file
|
|||||||
just before release. The output is in UTF-8.
|
just before release. The output is in UTF-8.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
|
def get_parser():
|
||||||
|
"""Return an argument parser for this module."""
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument('version',
|
||||||
|
help='Release version to look up')
|
||||||
|
return parser
|
||||||
|
|
||||||
|
|
||||||
def list_fixed_bugs(version):
|
def list_fixed_bugs(version):
|
||||||
"""List the bugs fixed in a given version."""
|
"""List the bugs fixed in a given version."""
|
||||||
url = ('https://sourceware.org/bugzilla/rest.cgi/bug?product=glibc'
|
url = ('https://sourceware.org/bugzilla/rest.cgi/bug?product=glibc'
|
||||||
@ -42,5 +52,13 @@ def list_fixed_bugs(version):
|
|||||||
subsequent_indent=' ') + '\n'
|
subsequent_indent=' ') + '\n'
|
||||||
sys.stdout.buffer.write(desc.encode('utf-8'))
|
sys.stdout.buffer.write(desc.encode('utf-8'))
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
"""The main entry point."""
|
||||||
|
parser = get_parser()
|
||||||
|
opts = parser.parse_args(argv)
|
||||||
|
list_fixed_bugs(opts.version)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
list_fixed_bugs(sys.argv[1])
|
main(sys.argv[1:])
|
||||||
|
Reference in New Issue
Block a user