diff --git a/README.md b/README.md index 24035fc..9fb792e 100644 --- a/README.md +++ b/README.md @@ -109,9 +109,9 @@ See the full help info: sigexport --help ``` -Disable pagination on HTML, and overwrite anything at the destination: +Disable pagination on HTML: ```bash -sigexport --paginate=0 --overwrite ~/signal-chats +sigexport --paginate=0 ~/signal-chats ``` List available chats and exit: diff --git a/sigexport/main.py b/sigexport/main.py index 0a2b70f..27d46e3 100755 --- a/sigexport/main.py +++ b/sigexport/main.py @@ -43,6 +43,11 @@ def main( include_empty: bool = Option( False, "--include-empty", help="Whether to include empty chats" ), + overwrite: bool = Option( + False, + "--overwrite/--no-overwrite", + help="Overwrite contents of output directory if it exists", + ), verbose: bool = Option(False, "--verbose", "-v"), use_docker: bool = Option( True, help="Use Docker container for SQLCipher extraction" @@ -179,7 +184,7 @@ def main( dest = Path(dest).expanduser() if not dest.is_dir(): dest.mkdir(parents=True, exist_ok=True) - else: + elif not overwrite: secho( f"Output folder '{dest}' already exists, didn't do anything!", fg=colors.RED )