Add validations to check if a cipher or an analyzer is available.
continuous-integration/drone/push Build is passing Details

dev 0.6.2
KKlochko 2 years ago
parent 2f0254f677
commit ef87a719a3

@ -62,6 +62,16 @@
(file/is-file-exists? (:output-file options))) (file/is-file-exists? (:output-file options)))
{:exit-message (error-msg ["Please, choose another file!!! Overwriting was prevented!!!"])} {:exit-message (error-msg ["Please, choose another file!!! Overwriting was prevented!!!"])}
(false? (contains? options/cipher-options (:cipher options)))
{:exit-message (error-msg ["Please, choose an available cipher!!!\n"
(options/get-available-cipher-options-as-string)])}
(and (map-has-keys? options [:cipher, :cracking, :analyzer])
(false? (contains?
(get options/analyzers-options (:cipher options)) (:analyzer options))))
{:exit-message (error-msg ["Please, choose an available analyzer!!!\n"
(options/get-available-analyzers-options-as-string)])}
(and (map-has-keys? options [:cipher, :key]) (and (map-has-keys? options [:cipher, :key])
(or (contains? options :message) (or (contains? options :message)
(contains? options :message-file)) (contains? options :message-file))

Loading…
Cancel
Save