From 320ae7ca70c270dd0a5002fdfc94307361c3956b Mon Sep 17 00:00:00 2001 From: yhoogstrate Date: Tue, 3 Mar 2020 15:59:26 +0100 Subject: [PATCH] release notes v1.7.5 --- CMakeLists.txt | 2 +- Changelog | 10 ++++++++-- src/main.cpp | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae7a45fc..e37568f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ project(fastafs) # Do this once in a while - find different bugs #set(CMAKE_CXX_COMPILER "clang++") -set(PROJECT_VERSION "1.7.4") +set(PROJECT_VERSION "1.7.5") set(PACKAGE_URL "https://github.com/yhoogstrate/fastafs") set(PACKAGE_BUGREPORT "${PACKAGE_URL}/issues") diff --git a/Changelog b/Changelog index 36f8132e..6c5d1bef 100644 --- a/Changelog +++ b/Changelog @@ -1,9 +1,15 @@ -2020-20-27 Youri Hoogstrate +2020-03-03 Youri Hoogstrate + + * v1.7.5 + * Added argument `check -5/--md5sum` to do file verification using md5sums as well + * Fixed error code returned after `fastafs check --help` + +2020-02-27 Youri Hoogstrate * v1.7.4 * Added argument `cache --2bit` for statistical analysis -2020-20-26 Youri Hoogstrate +2020-02-26 Youri Hoogstrate * v1.7.3 * Small decoy function added for basic snakemake compatiblity diff --git a/src/main.cpp b/src/main.cpp index 762967ca..8f2d92f4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,6 +61,7 @@ void usage_check(void) { std::cout << "usage: " << PACKAGE << " check [] \n\n"; std::cout << " -f, --file Provide fastafs by file path, not from database (cache)" << std::endl; + std::cout << " -5, --md5 Check file integrity using whole-file-CRC32 plus per-sequence MD5" << std::endl; std::cout << std::endl; std::cout << " -h, --help Display this help and exit"; std::cout << std::endl; @@ -272,12 +273,21 @@ int main(int argc, char *argv[]) } } else if(strcmp(argv[1], "check") == 0) { if(argc > 2) { + if(strcmp(argv[2], "--help") == 0 or strcmp(argv[2], "-h") == 0) { + usage_check(); + exit(0); + } + bool from_file = false; + bool check_md5 = false; for(int i = 2; i < argc - 1; i++) { if(strcmp(argv[i], "-f") == 0 or strcmp(argv[i], "--file") == 0) { from_file = true; } + else if (strcmp(argv[i], "-5") == 0 or strcmp(argv[i], "--md5") == 0) { + check_md5 = true; + } } std::string fname; @@ -297,7 +307,12 @@ int main(int argc, char *argv[]) f.load(fname); bool check1 = f.check_file_integrity(true); - bool check2 = f.check_sequence_integrity(true); + bool check2 = true; + + if(check_md5) { + check2 = f.check_sequence_integrity(true); + } + if(check1 and check2) { return 0; } else {