()
return path, text
Gets the profile file and completion text for the current shell

    :raises SystemExit: If not in a valid shell
Gets the profile file and completion text for the current shell
Gets the profile file and completion text for the current shell
def _validate_shell() -> Tuple[Path, str]:
    """
    Gets the profile file and completion text for the current shell

    :raises SystemExit: If not in a valid shell
    """
    shell_env = os.environ.get("SHELL")
    logging.info(f"Using shell {shell_env}")
    if not shell_env:
        echo_error(
            f"This command must be executed within one of the {VALID} shells. (Currently not in a shell)."
        )
        sys.exit(1)

    shell = shell_env.split("/")[-1]
    if shell not in SUPPORTED:
        echo_error(
            f"This command must be executed within one of the {VALID} shells. (Currently using {shell})."
        )
        sys.exit(1)

    profile, text = SUPPORTED[shell]
    path = Path.home() / profile

    return path, text
def _validate_shell ( ) -> Tuple [ Path , str ] : shell_env = os . environ . get ( "SHELL" ) logging . info ( f"Using shell {shell_env}" ) if not shell_env : echo_error ( f"This command must be executed within one of the {VALID} shells. (Currently not in a shell)." ) sys . exit ( 1 ) shell = shell_env . split ( "/" ) [ - 1 ] if shell not in SUPPORTED : echo_error ( f"This command must be executed within one of the {VALID} shells. (Currently using {shell})." ) sys . exit ( 1 ) profile , text = SUPPORTED [ shell ] path = Path . home ( ) / profile return path , text