From df8f580f93d0d416a132d0fab4bb84558e83a52c Mon Sep 17 00:00:00 2001 From: KKlochko Date: Mon, 2 Oct 2023 22:29:22 +0300 Subject: [PATCH] Fix writing to a file only when the option is set. --- src/cipher_analytical_machine/cli.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cipher_analytical_machine/cli.clj b/src/cipher_analytical_machine/cli.clj index 1ea0653..2b198c7 100644 --- a/src/cipher_analytical_machine/cli.clj +++ b/src/cipher_analytical_machine/cli.clj @@ -147,7 +147,8 @@ (defn show-and-save-output "Print and save the output to a file if needed" [output options] - (save-output output options) + (when (contains? options :output-file) + (save-output output options)) (println output)) (defn cracking-actions