Skip to content

Commit

Permalink
Fix nargs parameter 'backup_specific_or_all_chat_call'
Browse files Browse the repository at this point in the history
So `--backup_specific_or_all_chat_call all` works
  • Loading branch information
kuhnst-akros-ch committed Oct 20, 2024
1 parent 5ab6e63 commit 12b3e31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def close_db_connections(databases: List[sqlite3.Connection]) -> None:
"--backup_specific_or_all_chat_call",
"-e",
nargs="*",
default="all",
default=["all"],
help="Phone numbers (format: XXXXXXXXXXXX) of the chats and/or call logs that you want to extract from the database",
)
args = ap.parse_args()
Expand All @@ -98,7 +98,7 @@ def close_db_connections(databases: List[sqlite3.Connection]) -> None:
)

if args.backup_output_style == "raw_txt":
if args.backup_specific_or_all_chat_call == "all":
if args.backup_specific_or_all_chat_call == ["all"]:
if "chats" in args.backup_strategy:
output_chat_directory = args.parsed_backup_output_dir + CHAT_DIR
if not os.path.exists(output_chat_directory):
Expand Down Expand Up @@ -153,7 +153,7 @@ def close_db_connections(databases: List[sqlite3.Connection]) -> None:
)

elif args.backup_output_style == "formatted_txt":
if args.backup_specific_or_all_chat_call == "all":
if args.backup_specific_or_all_chat_call == ["all"]:
if "chats" in args.backup_strategy:
output_chat_directory = args.parsed_backup_output_dir + CHAT_DIR
if not os.path.exists(output_chat_directory):
Expand Down Expand Up @@ -208,7 +208,7 @@ def close_db_connections(databases: List[sqlite3.Connection]) -> None:
)

elif args.backup_output_style == "json":
if args.backup_specific_or_all_chat_call == "all":
if args.backup_specific_or_all_chat_call == ["all"]:
if "chats" in args.backup_strategy:
output_chat_directory = args.parsed_backup_output_dir + CHAT_DIR
if not os.path.exists(output_chat_directory):
Expand Down

0 comments on commit 12b3e31

Please sign in to comment.