diff options
author | David Phillips <david@sighup.nz> | 2017-05-15 11:25:58 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-05-15 11:25:58 +1200 |
commit | bc232e35d872b49865c1551fa5b0857da86493cd (patch) | |
tree | 3968cf962d970c8cab163b7abdc08791ee321754 | |
parent | 1c38e640ec5d0b952099a02387b90b13026d0c9d (diff) | |
download | sand-leek-bc232e35d872b49865c1551fa5b0857da86493cd.tar.xz |
Add version option -V
-rw-r--r-- | sand-leek.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sand-leek.c b/sand-leek.c index d35d0a6..3a88a67 100644 --- a/sand-leek.c +++ b/sand-leek.c @@ -15,6 +15,8 @@ #include "onion_base32.h" +#define VERSION "0.5" + #define EXPONENT_SIZE_BYTES 4 #define EXPONENT_MIN 0x1FFFFFFF #define EXPONENT_MAX 0xFFFFFFFF @@ -251,6 +253,16 @@ monitor_progress(unsigned long volatile *khashes, int thread_count) { fputc('\n', stderr); } +void +show_version(void) { +#ifdef AVX_ONION_BASE32 +# define EXTENSIONS "AVX Base32 Algorithm" +#else +# define EXTENSIONS "None" +#endif + printf("sand-leek "VERSION" built with extensions: "EXTENSIONS"\n"); +} + int main(int argc, char **argv) { int opt = '\0'; @@ -260,8 +272,11 @@ main(int argc, char **argv) { pthread_t *workers = NULL; unsigned long volatile *khashes = NULL; - while ((opt = getopt(argc, argv, "t:s:")) != -1) { + while ((opt = getopt(argc, argv, "t:s:V")) != -1) { switch (opt) { + case 'V': + show_version(); + return 0; case 't': thread_count = atoi(optarg); break; |