Skip to content
Merged
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bqtools"
version = "0.5.5"
version = "0.5.6"
edition = "2021"
license = "MIT"
authors = ["Noam Teyssier <noam.teyssier@arcinstitute.org>"]
Expand Down Expand Up @@ -31,6 +31,8 @@ rand = "0.10.0"
regex = "1.12.2"
sassy = { version = "0.2.1", optional = true }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
thousands = "0.2.0"
walkdir = "2.5.0"
zstd = { version = "0.13.3", features = ["zstdmt"] }

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,14 @@ bqtools info input.vbq --show-index

# print out the CBQ block headers
bqtools info input.cbq --show-headers

# export as json
bqtools info input.cbq --json
```

> Note: using `info` without the `--json` flag will format the number of records to include underscores to delimit the thousands.
> To avoid this behavior or to pass raw numerical values forward use the `--json` flag.

### Grep

You can easily search for specific subsequences or regular expressions within BINSEQ files:
Expand Down
16 changes: 9 additions & 7 deletions src/cli/info.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use clap::Parser;

use super::InputBinseq;

#[derive(Parser, Debug)]
/// Show information about a BINSEQ file.
pub struct InfoCommand {
#[clap(flatten)]
pub input: InputBinseq,
#[clap(num_args=1.., required=true)]
pub input: Vec<String>,

#[clap(flatten)]
pub opts: InfoOpts,
Expand All @@ -16,14 +14,18 @@ pub struct InfoCommand {
#[clap(next_help_heading = "INFO OPTIONS")]
pub struct InfoOpts {
/// Only print the number of records in the file
#[clap(short, long)]
#[clap(short, long, conflicts_with_all=["json", "show_index", "show_headers"])]
pub num: bool,

/// Print the file in JSON format
#[clap(short, long, conflicts_with_all=["show_index", "show_headers", "num"])]
pub json: bool,

/// Print the index of the file
#[clap(long)]
#[clap(long, conflicts_with_all=["json", "show_headers", "num"])]
pub show_index: bool,

/// Print the block headers of the file
#[clap(long, conflicts_with = "show_index")]
#[clap(long, conflicts_with_all=["json", "show_index", "num"])]
pub show_headers: bool,
}
Loading
Loading