def cli(ctx, debug, config, path): """ \U0001F98A Inspect and search through the complexity of your source code. To get started, run setup: $ wily setup To reindex any changes in your source code: $ wily build <src> Then explore basic metrics with: $ wily report <file> You can also graph specific metrics in a browser with: $ wily graph <file> <metric> """ ctx.ensure_object(dict) ctx.obj["DEBUG"] = debug if debug: logger.setLevel("DEBUG") else: logger.setLevel("INFO") ctx.obj["CONFIG"] = load_config(config) if path: logger.debug(f"Fixing path to {path}") ctx.obj["CONFIG"].path = path ctx.obj["CONFIG"].cache_path = os.path.join(path, DEFAULT_CACHE_PATH) logger.debug(f"Loaded configuration from {config}")
def cli(ctx, debug, config, path, cache): """CLI entry point.""" ctx.ensure_object(dict) ctx.obj["DEBUG"] = debug if debug: logger.setLevel("DEBUG") else: logger.setLevel("INFO") ctx.obj["CONFIG"] = load_config(config) if path: logger.debug(f"Fixing path to {path}") ctx.obj["CONFIG"].path = path if cache: logger.debug(f"Fixing cache to {cache}") ctx.obj["CONFIG"].cache_path = cache logger.debug(f"Loaded configuration from {config}") logger.debug(f"Capturing logs to {WILY_LOG_NAME}")