Skip to content

Commit

Permalink
style: uniform formatting of cmdline options
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 25, 2022
1 parent 1a75ebb commit 2ff2439
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions coverage/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class Opts:
help="The context label to record for this coverage run.",
)
contexts = optparse.make_option(
'', '--contexts', action='store',
metavar="REGEX1,REGEX2,...",
'', '--contexts', action='store', metavar="REGEX1,REGEX2,...",
help=(
"Only display data from lines covered in the given contexts. " +
"Accepts Python regexes, which must be quoted."
Expand Down Expand Up @@ -102,8 +101,7 @@ class Opts:
help="Ignore errors while reading source files.",
)
include = optparse.make_option(
'', '--include', action='store',
metavar="PAT1,PAT2,...",
'', '--include', action='store', metavar="PAT1,PAT2,...",
help=(
"Include only files whose paths match one of these patterns. " +
"Accepts shell-style wildcards, which must be quoted."
Expand All @@ -128,26 +126,22 @@ class Opts:
),
)
omit = optparse.make_option(
'', '--omit', action='store',
metavar="PAT1,PAT2,...",
'', '--omit', action='store', metavar="PAT1,PAT2,...",
help=(
"Omit files whose paths match one of these patterns. " +
"Accepts shell-style wildcards, which must be quoted."
),
)
output_xml = optparse.make_option(
'-o', '', action='store', dest="outfile",
metavar="OUTFILE",
'-o', '', action='store', dest="outfile", metavar="OUTFILE",
help="Write the XML report to this file. Defaults to 'coverage.xml'",
)
output_json = optparse.make_option(
'-o', '', action='store', dest="outfile",
metavar="OUTFILE",
'-o', '', action='store', dest="outfile", metavar="OUTFILE",
help="Write the JSON report to this file. Defaults to 'coverage.json'",
)
output_lcov = optparse.make_option(
'-o', '', action='store', dest='outfile',
metavar="OUTFILE",
'-o', '', action='store', dest='outfile', metavar="OUTFILE",
help="Write the LCOV report to this file. Defaults to 'coverage.lcov'",
)
json_pretty_print = optparse.make_option(
Expand Down Expand Up @@ -199,8 +193,10 @@ class Opts:
)
sort = optparse.make_option(
'--sort', action='store', metavar='COLUMN',
help="Sort the report by the named column: name, stmts, miss, branch, brpart, or cover. " +
help=(
"Sort the report by the named column: name, stmts, miss, branch, brpart, or cover. " +
"Default is name."
),
)
source = optparse.make_option(
'', '--source', action='store', metavar="SRC1,SRC2,...",
Expand Down

0 comments on commit 2ff2439

Please sign in to comment.