From 2078e98738607b81285fb73ef55b1e60836c488b Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 5 Jan 2024 15:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 35 +++++++------------------------ ncbi/Cargo.toml | 10 +-------- ncbi/src/{bin/ncbi.rs => main.rs} | 0 3 files changed, 9 insertions(+), 36 deletions(-) rename ncbi/src/{bin/ncbi.rs => main.rs} (100%) diff --git a/README.md b/README.md index b993b88..c4b7cdf 100644 --- a/README.md +++ b/README.md @@ -3,38 +3,19 @@ ## 从 NCBI 下载数据 ``` -cargo run --bin ncbi -- -h - Compiling ncbi v0.1.0 (/Users/eric/kraken2-rust/ncbi) - Finished dev [unoptimized + debuginfo] target(s) in 0.79s - Running `target/debug/ncbi -h` +$ ./ncbi -h ncbi download resource Usage: ncbi [OPTIONS] Options: - -l, --list 列出 NCBI 站点上的种类列表信息,实时拉取 - -d, --database 构建数据库的目录 [default: lib] - -g, --group 从 NCBI 站点上下载某个种类的数据信息,必须是列表中所列名称 - -c, --check-md5 检查文件的 md5 [default: true] [possible values: true, false] - -p, --parallel 下载时的并行大小 [default: 8] - -h, --help Print help (see more with '--help') - -V, --version Print version - -``` - -### md5 文件校验 -``` -cargo run --bin ncbi_md5 -- -h - Finished dev [unoptimized + debuginfo] target(s) in 0.07s - Running `target/debug/ncbi_md5 -h` -ncbi check genomics file md5sum - -Usage: ncbi_md5 [OPTIONS] - -Options: - -d, --database 数据库的路径 [default: lib] - -g, --group 从 NCBI 站点上下载某个种类的数据信息,必须是列表中所列名称 - --delete 删除校验错误的文件 + -l, --list 列出 NCBI 站点上的种类列表信息,实时拉取 + -d, --database 构建数据库的目录 [default: lib] + -g, --group 从 NCBI 站点上下载某个种类的数据信息,必须是列表中所列名称,archaea,bacteria,fungi... + -m, --md5 仅检查文件的 md5 + -t, --threads 下载时的并行大小 [default: 8] -h, --help Print help (see more with '--help') -V, --version Print version + ``` + diff --git a/ncbi/Cargo.toml b/ncbi/Cargo.toml index 21ae5bf..0b69c2b 100644 --- a/ncbi/Cargo.toml +++ b/ncbi/Cargo.toml @@ -1,18 +1,10 @@ [package] name = "ncbi" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[[bin]] -name = "ncbi" -path = "src/bin/ncbi.rs" - -# [[bin]] -# name = "ncbi_md5" -# path = "src/bin/md5.rs" - [dependencies] reqwest = { version = "0.11", features = ["stream", "multipart", "gzip"] } tokio = { version = "1", features = ["full"] } diff --git a/ncbi/src/bin/ncbi.rs b/ncbi/src/main.rs similarity index 100% rename from ncbi/src/bin/ncbi.rs rename to ncbi/src/main.rs