-
Notifications
You must be signed in to change notification settings - Fork 23
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
Rework cmd-line interface with Inclusions/eXclusions #10
Comments
There are two changes here, I don't like the first because my most common use case is usually to see if the thing I'm reversing is a file name or the file itself, so I want to be able to No need to replace -c, but I'd like to have '-f' for filter or family for includes, so that I could only do the SHA family as you descibed, ex Similarly, I'd like to have a '-m' for match, so that I could either only show algos that match a target, or just highlight target out put. ex,
This is becoming a quite useful hash multitool! |
...indeed it does become quite useful multitool. |
I'm fine with exclusions, as long as it's Let's hold off on the config file for right now. People always think they want a config file.. but they don't. They really don't. If somebody demands a specific usage for it.. well, PRs welcome. |
No more PRs from me, I'm done my duty, just discussion :-)
So the failback to string if file is not found, is it still desired? Finally, if |
Yeah, I want to keep "failback", as you put it, to be the string. That's still been primary use case so far, just hashing random strings as needed. That's why I wrote the tool to begin with! :-P (I need to hash a word! Yeah, it does seem asymmetrical, but that doesn't bother me because '-i' usually means input, and I think I'd actually prefer it if '-f' meant "family", as that's how most cryptographers using this would probably think. I'd wager that the common use case here is that you just want the sha family, sha3 family, ripe family, etc. |
@Miserlou I really believe that this 'fallback-to-string" is a dangerous feature - at least have it as opt-in with a new option (inverse of |
Why do you say dangerous? |
The danger comes from the non-determinism; the result depends on the working-directory you are. I make example-presentations in bash for git, and frequently I create sample files like this:
Then when I type Besides, all standard unix command-tools do not behave like that. Look at |
By the way, I really enjoy traditional behavior, where if you don't specify anything,
Maybe I'm too addicted to the unix way... |
Thanks for the |
Oups! Neglected my own children: plugins :-) Thanks! |
I think there is a pretty simple solution for having a command with the traditional unix-y behavior & deterministic hashing (string or file, not just any of them, depending on the existence of the file),
@Miserlou what do you think? |
+ Improve help-messages. + `Omnihash` behaves like unix (ie `sha1sum`), so no prompt appear when reading STDIN. + `oh` heuristic behavior on existence of files/urls behaves unchanged. FIX Miserlou#10
+ Improve help-messages. + `Omnihash` behaves like unix (ie `sha1sum`), so no prompt appear when reading STDIN. + `oh` heuristic behavior on existence of files/urls behaves unchanged. FIX Miserlou#10
+ Improve help-messages. + `Omnihash` behaves like unix (ie `sha1sum`), so no prompt appear when reading STDIN. + `oh` heuristic behavior on existence of files/urls behaves unchanged. FIX Miserlou#10
+ Improve help-messages. + `Omnihash` behaves like unix (ie `sha1sum`), so no prompt appear when reading STDIN. + `oh` heuristic behavior on existence of files/urls behaves unchanged. FIX Miserlou#10
+ Improve help-messages. + `Omnihash` behaves like unix (ie `sha1sum`), so no prompt appear when reading STDIN. + `oh` heuristic behavior on existence of files/urls behaves unchanged. FIX Miserlou#10
I'm opening this issue to discuss some proposed changes to the command-line options and behavior.
Hashing of strings arguments:
After #7, the
omnihash
command can consume strings fromstdin
, so now the "-s
sting in cmd-line option" or failling-back to "assume args as strings" it is better to go:for simplification: currently the command behaves like
echo
andcat
combined;it is too resilient(!), violating the "fail early" rule. Let's take this example:
That's the empty string DSA, but unless you peek at the informational heder or know it by hurt, it is easy to miss that
foo
file were not actually found, and accept only this:Add Inclusion/Exclusion flags:
Assuming #9 gets merged, unforeseen algos may clutter output - even now, it would be handier to eliminate some algos. So I'm suggesting to replace
-c
with one or more of the following:-X
exclude: e.g.omnihash -X crc
excludes all algos having this upper string in their names-I
include: e.g. `omnihash -I sha3 prints only SHA3 algos. exlusions must apply afterwards,The text was updated successfully, but these errors were encountered: