aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2023-03-22 21:27:52 +1100
committerNicholas Tay <nick@windblume.net>2023-03-22 21:27:52 +1100
commit381c99723cf3d76c8bb7a7e2fb5fb3f26bf7804d (patch)
tree7093d290431382f62237a0723e5afabf62818cce
parent319cd947618d4ebaffc8aba636d017fe5c956025 (diff)
downloadpassgen-0.1.1.tar.gz
passgen-0.1.1.tar.bz2
passgen-0.1.1.zip
Add version to app itselfv0.1.1
-rw-r--r--passgen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/passgen.c b/passgen.c
index f4112af..d8b2201 100644
--- a/passgen.c
+++ b/passgen.c
@@ -5,6 +5,8 @@
#include <stdbool.h>
#include <string.h>
+#define VERSION "0.1.1"
+
#if defined (__linux__) \
|| defined (__APPLE__) \
|| defined (__FreeBSD__) \
@@ -140,7 +142,7 @@ int main(int argc, char *argv[])
if (argc == 2) {
if (strcmp(argv[1], "--help") == 0) {
printf("\
-passgen - a small, customisable password generator\n\
+passgen v"VERSION" - a small, customisable password generator\n\
Usage: %s\n\
%s <grammar>\n\
%s <#triplets ('Cvc')> <#symbols> <#numbers>\n\
@@ -155,7 +157,10 @@ Compile-time options (edit `config.h` to customise!):\n\
printf(" - '%c' => \"%s\"\n", classes[i].c, classes[i].letters);
}
return 0;
- }
+ } else if (strcmp(argv[1], "--version") == 0) {
+ printf("passgen v"VERSION"\n");
+ return 0;
+ }
/* Take first argument as the grammar */
grammar = argv[1];
grammar_size = strlen(grammar);