Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SafetyQuincyF committed Nov 14, 2024
1 parent 9938769 commit ae6c091
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions safety/auth/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ..cli_util import get_command_for, pass_safety_cli_obj, SafetyCLISubGroup

from .constants import MSG_FAIL_LOGIN_AUTHED, MSG_FAIL_REGISTER_AUTHED, MSG_LOGOUT_DONE, MSG_LOGOUT_FAILED, MSG_NON_AUTHENTICATED
from safety.scan.constants import CLI_AUTH_COMMAND_HELP, DEFAULT_EPILOG, CLI_AUTH_LOGIN_HELP, CLI_AUTH_LOGOUT_HELP, CLI_AUTH_STATUS_HELP
from safety.scan.constants import CLI_AUTH_COMMAND_HELP, CLI_AUTH_HEADLESS_HELP, DEFAULT_EPILOG, CLI_AUTH_LOGIN_HELP, CLI_AUTH_LOGOUT_HELP, CLI_AUTH_STATUS_HELP


from rich.padding import Padding
Expand Down Expand Up @@ -124,7 +124,17 @@ def render_successful_login(auth: Auth,


@auth_app.command(name=CMD_LOGIN_NAME, help=CLI_AUTH_LOGIN_HELP)
def login(ctx: typer.Context, headless: bool = False) -> None:
def login(
ctx: typer.Context,
headless: Annotated[
Optional[bool],
typer.Option(
"--headless",
help=CLI_AUTH_HEADLESS_HELP,
)
] = None
) -> None:
headless = headless is True
"""
Authenticate Safety CLI with your safetycli.com account using your default browser.
Expand Down
2 changes: 2 additions & 0 deletions safety/scan/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"Example:\n safety auth login --headless"
)

CLI_AUTH_HEADLESS_HELP = "For headless authentication, you will receive a URL to paste into an external browser."

CLI_SCAN_COMMAND_HELP = "Scans a Python project directory."\
"\nExample: safety scan to scan the current directory"
CLI_SYSTEM_SCAN_COMMAND_HELP = "\\[beta] Run a comprehensive scan for packages and vulnerabilities across your entire machine/environment."\
Expand Down

0 comments on commit ae6c091

Please sign in to comment.