Skip to content

Commit

Permalink
refactor: adjust to cli() and cli_internal()
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpulver committed Jul 5, 2024
1 parent d011dbe commit 0df74b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions safety/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@

LOG = logging.getLogger(__name__)

def cli():
preprocess_args()
cli_internal()

def preprocess_args():
# Preprocess the arguments before Click processes them
if '--debug' in sys.argv:
Expand All @@ -58,7 +62,6 @@ def preprocess_args():
if next_arg in ('1', 'true'):
sys.argv.pop(index + 1) # Remove the next argument (1 or true)


def configure_logger(ctx, param, value):
level = logging.CRITICAL
if value:
Expand All @@ -75,7 +78,7 @@ def configure_logger(ctx, param, value):
@click.version_option(version=get_safety_version())
@click.pass_context
@inject_session
def cli(ctx, debug, disable_optional_telemetry):
def cli_internal(ctx, debug, disable_optional_telemetry):
"""
Scan and secure Python projects against package vulnerabilities. To get started navigate to a Python project and run `safety scan`.
"""
Expand Down Expand Up @@ -727,9 +730,6 @@ def check_updates(ctx: typer.Context,

cli.add_command(alert)

def main():
preprocess_args()
cli()

if __name__ == "__main__":
main()
cli()

0 comments on commit 0df74b1

Please sign in to comment.