samuel-lucas6 / Kryptor

A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
https://www.kryptor.co.uk
GNU General Public License v3.0
431 stars 33 forks source link

✨ Feedback: Better UX: Error: This file/folder doesn't exist. #18

Closed dawidmachon closed 3 years ago

dawidmachon commented 3 years ago

Description

After using the "-e -p" options command, the program first asks you for the password and then informs you that you typed the wrong file name. It would be more logical to reverse the check.

X:\Some\Windows\Path\kryptor-windows> ./kryptor -e -p MyMissTypoFile.txt
Enter a password (leave empty for a random passphrase):
Retype password:

MyMissTypoFile.txt - Error: This file/folder doesn't exist.
samuel-lucas6 commented 3 years ago

I completely agree, but sadly it's not quite that simple. Because Kryptor supports multiple files and/or folders being specified at once, each path is being checked in a loop to process each file/folder one at a time, and there are also several checks (e.g. whether the file has the Kryptor magic bytes).

I think the reason I did it this way was to continue processing existing files/folders rather than giving an error if only one path is wrong. I will take a proper look when I get the time. There's got to be a better way of writing it.

samuel-lucas6 commented 3 years ago

I promise I will get around to looking at this, but I have exams throughout June unfortunately, so I haven't been doing much programming lately.

samuel-lucas6 commented 3 years ago

Fixed in v3.0.3.