Allow -I/--explain to be specified multiple times.

Specifying comma separated message ids is deprecated but still
supported for now for backwards compatibility.


git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1855 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2011-04-22 20:46:28 +00:00
parent 8d9f5e29ce
commit ba7a139295
2 changed files with 7 additions and 6 deletions

View File

@ -45,7 +45,7 @@ def usage(name):
print ('''usage: %s [<options>] <rpm files|installed packages|specfiles|dirs>
options:
\t[-i|--info]
\t[-I|--explain <messageid,messageid,...>]
\t[-I|--explain <messageid>]
\t[-c|--check <check>]
\t[-a|--all]
\t[-C|--checkdir <checkdir>]
@ -268,7 +268,7 @@ conf_file = _default_user_conf
if not os.path.exists(os.path.expanduser(conf_file)):
# deprecated backwards compatibility with < 0.88
conf_file = '~/.rpmlintrc'
info_error = None
info_error = set()
# load global config files
configs = glob.glob('/etc/rpmlint/*config')
@ -306,7 +306,8 @@ for o in opt:
elif o[0] in ('-i', '--info'):
Config.info = True
elif o[0] in ('-I', '--explain'):
info_error = o[1]
# split by comma for deprecated backwards compatibility with < 1.2
info_error.update(o[1].split(','))
elif o[0] in ('-h', '--help'):
usage(sys.argv[0])
sys.exit(0)
@ -356,7 +357,7 @@ if info_error:
Config.addCheck(c)
for c in Config.allChecks():
loadCheck(c)
for e in info_error.split(','):
for e in sorted(info_error):
print "%s:" % e
printDescriptions(e)
sys.exit(0)

View File

@ -21,9 +21,9 @@ pattern to match installed packages, unless a file by that name exists.
\fB\-i\fR, \fB\-\-info\fR
Display explanations for reported messages.
.TP
\fB-I\fR, \fB\-\-explain\fR=\fImessageid\fR[,\fImessageid\fR...]
\fB-I\fR, \fB\-\-explain\fR=\fImessageid\fR
Display explanations for the specified message identifiers and exit.
Multiple identifiers can be specified by separating them with commas.
This option may be given multiple times.
.TP
\fB\-c\fR, \fB\-\-check\fR=\fIcheck\fR
Run only the specified check. This option may be given multiple times