Skip to content

Commit

Permalink
Add verbose flag
Browse files Browse the repository at this point in the history
  • Loading branch information
danlamanna committed Feb 11, 2022
1 parent 6761a84 commit 90e0d5c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion isic_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from importlib.metadata import PackageNotFoundError, version
import logging
import os
import platform
import sys
Expand Down Expand Up @@ -52,7 +53,15 @@ def make_app():
app.command('login')(login)

@app.callback()
def main(ctx: typer.Context):
def main(ctx: typer.Context, verbose: bool = False):
if verbose:
from http.client import HTTPConnection

requests_log = logging.getLogger('requests.packages.urllib3')
HTTPConnection.debuglevel = 1
requests_log.addHandler(logging.StreamHandler(sys.stderr))
requests_log.setLevel(logging.DEBUG)

ctx.obj = get_oauth_client()
ctx.obj.maybe_restore_login()
if not ctx.obj.auth_headers:
Expand Down

0 comments on commit 90e0d5c

Please sign in to comment.