Merge branch 'master' of https://github.com/manuel-domke/infnoise
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
GIT_VERSION := $(shell git --no-pager describe --tags --always)
|
||||
GIT_COMMIT := $(shell git rev-parse --verify HEAD)
|
||||
GIT_DATE := $(firstword $(shell git --no-pager show --date=iso-strict --format="%ad" --name-only))
|
||||
BUILD_DATE := $(shell date --iso=seconds)
|
||||
|
||||
PREFIX = $(DESTDIR)/usr/local
|
||||
|
||||
CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -I Keccak -I /usr/include/libftdi1
|
||||
CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -I Keccak -I /usr/include/libftdi1 \
|
||||
-DGIT_VERSION=\"$(GIT_VERSION)\"\
|
||||
-DGIT_COMMIT=\"$(GIT_COMMIT)\"\
|
||||
-DGIT_DATE=\"$(GIT_DATE)\"\
|
||||
-DBUILD_DATE=\"$(BUILD_DATE)\"
|
||||
|
||||
FOUND = $(shell ldconfig -p | grep --silent libftdi.so && echo found)
|
||||
ifeq ($(FOUND), found)
|
||||
|
||||
@@ -299,6 +299,8 @@ int main(int argc, char **argv)
|
||||
opts.daemon = true;
|
||||
} else if(!strcmp(argv[xArg], "--list-devices")) {
|
||||
opts.listDevices = true;
|
||||
} else if(!strcmp(argv[xArg], "--version") || !strcmp(argv[xArg], "-v")) {
|
||||
opts.version = true;
|
||||
} else if(!strcmp(argv[xArg], "--help") || !strcmp(argv[xArg], "-h")) {
|
||||
opts.help = true;
|
||||
} else {
|
||||
@@ -320,6 +322,7 @@ int main(int argc, char **argv)
|
||||
" --daemon - run in the background\n"
|
||||
" --serial <serial> - use specified device\n"
|
||||
" --list-devices - list available devices\n"
|
||||
" --version - show version information\n"
|
||||
" --help - this help output\n", stdout);
|
||||
if (opts.none) {
|
||||
return 1;
|
||||
@@ -360,6 +363,14 @@ int main(int argc, char **argv)
|
||||
opts.outputMultiplier = 2u; // Don't throw away entropy when writing to /dev/random unless told to do so
|
||||
}
|
||||
|
||||
if (opts.version) {
|
||||
printf("GIT VERSION - %s\n", GIT_VERSION);
|
||||
printf("GIT COMMIT - %s\n", GIT_COMMIT);
|
||||
printf("GIT DATE - %s\n", GIT_DATE);
|
||||
printf("BUILD DATE - %s\n", BUILD_DATE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (opts.listDevices) {
|
||||
listUSBDevices(&ftdic);
|
||||
return 0;
|
||||
|
||||
@@ -41,6 +41,7 @@ struct opt_struct {
|
||||
bool help; // Show help
|
||||
bool none; // set to true when no valid arguments where detected
|
||||
bool raw; // No whitening?
|
||||
bool version; // Show version
|
||||
char *pidFileName; // Name of optional PID-file
|
||||
char *serial; // Name of selected device
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user