add --first and --debug flags
This commit is contained in:
parent
1c1a5e7992
commit
e1ff8918cc
|
@ -22,10 +22,23 @@ def ui(program, args):
|
||||||
desc = "enable all checks instead of only the most likely ones"
|
desc = "enable all checks instead of only the most likely ones"
|
||||||
parser.add_argument("--all", action="store_true", help=desc)
|
parser.add_argument("--all", action="store_true", help=desc)
|
||||||
|
|
||||||
|
desc = "enable only the first check"
|
||||||
|
parser.add_argument("--first", action="store_true", help=desc)
|
||||||
|
|
||||||
|
desc = "enable debugging verbosity"
|
||||||
|
parser.add_argument("--debug", action="store_true", help=desc)
|
||||||
|
|
||||||
a = parser.parse_args(args)
|
a = parser.parse_args(args)
|
||||||
|
|
||||||
checks = [] + chk.first
|
checks = [] + chk.first
|
||||||
checks += chk.checks if a.all else chk.likely
|
if a.first and a.all:
|
||||||
|
parser.error("--all and --first cannot be used together")
|
||||||
|
elif a.all:
|
||||||
|
checks += chk.checks
|
||||||
|
elif a.first:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
checks += chk.likely
|
||||||
|
|
||||||
opts = Options()
|
opts = Options()
|
||||||
opts.dry = a.database is None
|
opts.dry = a.database is None
|
||||||
|
@ -40,8 +53,8 @@ def ui(program, args):
|
||||||
else:
|
else:
|
||||||
uri = "sqlite:///" + a.database
|
uri = "sqlite:///" + a.database
|
||||||
|
|
||||||
def runwrap(db, debug=False):
|
def runwrap(db):
|
||||||
if debug:
|
if a.debug:
|
||||||
import logging
|
import logging
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
run(main(db, a.path, checks, opts), debug=True)
|
run(main(db, a.path, checks, opts), debug=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user