fix: warn when --private used without authentication

This commit is contained in:
Rodos
2025-12-07 21:20:54 +11:00
parent 9f7c08166f
commit aba048a3e9

View File

@@ -9,6 +9,7 @@ from github_backup.github_backup import (
backup_repositories,
check_git_lfs_install,
filter_repositories,
get_auth,
get_authenticated_user,
logger,
mkdir_p,
@@ -37,6 +38,12 @@ logging.basicConfig(level=logging.INFO, handlers=[stdout_handler, stderr_handler
def main():
args = parse_args()
if args.private and not get_auth(args):
logger.warning(
"The --private flag has no effect without authentication. "
"Use -t/--token, -f/--token-fine, or -u/--username to authenticate."
)
if args.quiet:
logger.setLevel(logging.WARNING)