Skip to content

Commit

Permalink
CLI: verbosity by downloads (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Apr 5, 2022
1 parent 31114a8 commit d339dc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions htmldate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## under GNU GPL v3 license

import argparse
import logging
import sys

from platform import python_version
Expand Down Expand Up @@ -69,6 +70,11 @@ def parse_args(args):

def process_args(args):
"""Process the arguments passed on the command-line."""
# verbosity
if args.verbose is True:
logging.basicConfig(level=logging.DEBUG)

# input type
if not args.inputfile:
# URL as input
if args.URL:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ def test_cli():
assert examine('<html><body>2016-07-12</body></html>', extensive_bool=True, maxdate='2017-12-31') == '2016-07-12'
assert examine('<html><body>2016-07-12</body></html>', extensive_bool=True, maxdate='2017-41-41') == '2016-07-12'
# first test
testargs = ['', '-u', '123']
testargs = ['', '-u', '123', '-v']
with patch.object(sys, 'argv', testargs):
args = parse_args(testargs)
with pytest.raises(SystemExit) as err:
Expand Down

0 comments on commit d339dc8

Please sign in to comment.