grep-merges: Use optparse to display --help

This commit is contained in:
Stefano Rivera 2012-05-06 05:24:14 +02:00
parent 927947841c
commit ed96c35dc1
3 changed files with 13 additions and 6 deletions

4
debian/changelog vendored
View File

@ -3,8 +3,8 @@ ubuntu-dev-tools (0.142) UNRELEASED; urgency=low
* mk-sbuild: Support kmod, when checking for overlayfs availability.
* pbuilder-dist: improve bash_completion for *.dsc files. Thanks Maarten
Bezemer. (Closes: #670924, LP: #770529)
* submittodebian, check-mir, check-symbols, ubuntu-iso: Do enough argument
parsing to handle --help (LP: #988009)
* check-mir, check-symbols, grep-merges, submittodebian, ubuntu-iso: Do
enough argument parsing to handle --help (LP: #988009)
-- Stefano Rivera <stefanor@debian.org> Wed, 25 Apr 2012 17:38:58 +0200

View File

@ -19,6 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import optparse
import sys
import json
@ -28,12 +29,19 @@ import ubuntutools.misc
def main():
ubuntutools.misc.require_utf8()
if len(sys.argv) > 1:
match = sys.argv[1]
parser = optparse.OptionParser(usage='%prog [options] [string]',
description='List pending merges from Debian matching string')
args = parser.parse_args()[1]
if len(args) > 1:
parser.error('Too many arguments')
elif len(args) == 1:
match = args[0]
else:
match = None
ubuntutools.misc.require_utf8()
for component in ('main', 'main-manual',
'restricted', 'restricted-manual',
'universe', 'universe-manual',

View File

@ -25,7 +25,6 @@ from ubuntutools import subprocess
from ubuntutools.test import unittest
BLACKLIST = {
'grep-merges': 'No Help',
'pbuilder-dist-simple': 'No Help',
'setup-packaging-environment': 'Throws Error',
}