Skip to content

Commit 771b480

Browse files
author
eric
committed
优化代码结构
1 parent a1a8146 commit 771b480

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

kr2r/src/bin/build_k2_db.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ use std::time::Instant;
1818
#[derive(Parser, Debug, Clone)]
1919
#[clap(author, version, about="build database", long_about = None)]
2020
pub struct Args {
21-
/// 包含原始配置
22-
#[clap(flatten)]
23-
pub build: Build,
24-
2521
/// database hash chunk directory and other files
2622
#[clap(long)]
2723
pub k2d_dir: Option<PathBuf>,
2824

29-
#[clap(flatten)]
30-
pub taxo: Taxo,
31-
3225
#[clap(long, value_parser = parse_size, default_value = "1G", help = "Specifies the hash file capacity.\nAcceptable formats include numeric values followed by 'K', 'M', or 'G' (e.g., '1.5G', '250M', '1024K').\nNote: The specified capacity affects the index size, with a factor of 4 applied.\nFor example, specifying '1G' results in an index size of '4G'.\nDefault: 1G (capacity 1G = file size 4G)")]
3326
pub hash_capacity: usize,
3427

3528
/// chunk temp directory
3629
#[clap(long)]
3730
pub chunk_dir: PathBuf,
31+
32+
/// 包含原始配置
33+
#[clap(flatten)]
34+
pub build: Build,
35+
36+
#[clap(flatten)]
37+
pub taxo: Taxo,
3838
}
3939

4040
pub fn run(args: Args, required_capacity: usize) -> Result<(), Box<dyn std::error::Error>> {

kr2r/src/bin/squid.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,23 @@ use std::time::Instant;
1717
#[derive(Parser, Debug, Clone)]
1818
#[clap(author, version, about="build database", long_about = None)]
1919
struct BuildArgs {
20-
#[clap(flatten)]
21-
pub build: Build,
22-
2320
/// database hash chunk directory and other files
2421
#[clap(long)]
2522
pub k2d_dir: Option<PathBuf>,
2623

27-
#[clap(flatten)]
28-
taxo: Taxo,
29-
30-
// /// Name of Kraken 2 database
31-
// #[arg(short, long = "db")]
32-
// database: PathBuf,
3324
/// chunk directory
3425
#[clap(long)]
3526
chunk_dir: PathBuf,
3627

3728
#[clap(long, value_parser = parse_size, default_value = "1G", help = "Specifies the hash file capacity.\nAcceptable formats include numeric values followed by 'K', 'M', or 'G' (e.g., '1.5G', '250M', '1024K').\nNote: The specified capacity affects the index size, with a factor of 4 applied.\nFor example, specifying '1G' results in an index size of '4G'.\nDefault: 1G (capacity 1G = file size 4G)")]
3829
pub hash_capacity: usize,
3930

31+
#[clap(flatten)]
32+
pub build: Build,
33+
34+
#[clap(flatten)]
35+
taxo: Taxo,
36+
4037
/// estimate capacity from cache if exists
4138
#[arg(long, default_value_t = true)]
4239
cache: bool,

kr2r/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// pub mod iclassify;
21
pub mod kr2r_data;
32
mod kv_store;
43
pub mod mmscanner;
@@ -16,7 +15,6 @@ pub use feat::*;
1615
pub mod db;
1716
pub use kr2r_data::*;
1817
pub use kv_store::*;
19-
// pub use mmscanner::{Meros, CURRENT_REVCOM_VERSION, DEFAULT_TOGGLE_MASK};
2018
pub use readcounts::TaxonCounts;
2119

2220
pub mod args;

0 commit comments

Comments
 (0)