What can I do to improve this help/usage message?
I'm currently developing a command line tool for unix. Since it is good practise to provide a decent help/usage message I decided to work on it a little.
There are two variants of this message. The first that get's displayed when the user entered an invalid amount of parameters or none at all. The second message gets displayed when the program is called with -h
or --help
.
These are the two messages:
Usage:
Display help:
crackstation -h
Create dictionary:
crackstation -c [-v] [test]... [-r <Size>] [-q] <wordlist> <dictionary> <hashtype>
Find hash in dictionary:
crackstation [-q] <wordlist> <dictionary> <hashtype> <hashes>...
Verify dictionary:
crackstation -v [test]... [-q] [wordlist] <dictionary> [hashtype]
List available hashes:
crackstation -l
Usage:
Display help:
crackstation -h
Create dictionary:
crackstation -c [-v] [test]... [-r <Size>] [-q] <wordlist> <dictionary> <hashtype>
Find hash in dictionary:
crackstation [-q] <wordlist> <dictionary> <hashtype> <hashes>...
Verify dictionary:
crackstation -v [test]... [-q] [wordlist] <dictionary> [hashtype]
List available hashes:
crackstation -l
Modes:
-h, --help, Print usage and exit.
-c, --create Creates the dictionary from the wordlist.
-v, --verify Verifies that the dictionary is sorted.
-l, --list Lists all available hashes separted by a space character.
General options:
-q, --quiet Disables most output. Usefull for automated scripts.
Create options:
-r, --ram=SIZE How much RAM (SIZE MiB) to use for the cache when sorting the index file.
(Only used when -c is set).
Verify options:
-a, --all Enables all tests. If "wordlist" and "hashtype" are not specified all tests
requiring them will be silently skipped!
Equivalent to: -s -m
-f, --fast Enables all fast tests. If no tests are specified these tests will be run.
If "wordlist" and "hashtype" are not specified all tests requiring them
will be silently skipped!
Equivalent to: -s -m RANDOM_FULL
-s, --sorted Checks whether the index file is sorted.
-m, --match[=MODE] Tries to hash and then find all or some entries from the wordlist
(depending on the mode). See below for match modes. Requires "wordlist" and
"hashtype" to be specified!
Match Modes:
ALL: Go through the entire word list and do full and partial matching. (Default)
ALL_FULL: Go through the entire word list and only do full matching.
ALL_PARTIAL: Go through the entire word list and only do partial matching.
RANDOM: Pick random elements from the word list and do full and partial matching.
RANDOM_FULL: Pick random elements from the word list and only do full matching.
RANDOM_PARTIAL: Pick random elements from the word list and only do partial matching.
Examples:
crackstation -c words.txt words-sha512.idx sha512
crackstation words.txt words-md5.idx md5 827CCB0EEA8A706C4C34A16891F84E7B
Note: The beginning of the second is identical to the first. (In case you were wondering)
I myself understand really well what that messages means and how to use the program. The question is would a user too? And if not what to do? I'm also not too happy with the general outline. Specifcally talking about that the modes come right after the program parameters. Also I'm not sure whether the speparation of the parameters is good.
Further I am not very happy with the usage part. It seems bulky and unnecessary large to me. Any ideas on how to improve that?
One minor side question:
Even though I explicitly mentioned at the parameters -a
and -f
that all test requiring the wordlist and the hashtype will be silently skipped if specified I'm wondering if this behavior is so counter intuitive that I should instead print a warning when somebody tries to run a test that cannot be run and remove this message.
In case you want some further information on the project itself you can find it here: https://github.com/BrainStone/crackstation-hashdb