Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the hash checking output #208

Open
Perkolator opened this issue Jun 27, 2022 · 4 comments
Open

Enhance the hash checking output #208

Perkolator opened this issue Jun 27, 2022 · 4 comments
Labels

Comments

@Perkolator
Copy link

When checking the hashes of a long list of files, the output is hard to read because the result of a line is appended to the end of the line, especially when filenames have varying lengths. Small example:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.txt OK
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do.txt OK
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.txt No such file or directory
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.txt OK
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.txt ERR

I propose that the result of checking a file is moved to the beginning of the line.

[ OK  ] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.txt
[ OK  ] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do.txt
[ MIS ] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.txt
[ OK  ] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.txt
[ ERR ] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.txt

So much easier to read and spot the problematic lines.

Also, if possible, add colours.

output_example

(picture example from my own bash script that checks multiple checksum files recursively using RHash in the background)

@rhash rhash added the FR label Jun 27, 2022
@AxelPetermann
Copy link

I would be also interested in this feature.

@AxelPetermann
Copy link

@Perkolator How did you do the reformatting shown in your screenshot?

@Perkolator
Copy link
Author

Perkolator commented Jan 2, 2024

It's my own bash script that does that output. It's not "reformatting" RHash output, it's a 400+ line bash script that does each hash file one by one using RHash in the background, it does not output RHash output (except in case an error is detected, then my script outputs some RHash output to an error file). It's just for my use, it's not ready for publishing for everyone.. I would need to change some things in it and I really don't have time to do it now. The screenshot is just a visual example for how the "verification messages at the beginning of a line" could be implemented.

EDIT: Actually, my script, if there's only one hash file found, then it outputs normal RHash verification (no "reformatting") of the files in the hash file.. the example picture is in case more than one hash file was found, then my script outputs that what you see in the picture, just the hash files (with possible relative folder path) and if the checking went ok or not (the yellow "check" is an indicator of that this hash file is currently being checked/verified, and it turns into red "error" or green "ok" message once it's ready and proceeds to the next hash file, or ends if none left).

@AxelPetermann
Copy link

@Perkolator Thanks for your quick reply. Will try to come up with my own solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants