Skip to content

Commit

Permalink
Fix CLI bug and push v0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bovee committed Jun 28, 2024
1 parent faca9f5 commit 7915869
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- os: ubuntu-latest
target: x86_64
- os: ubuntu-latest
target: armv7
target: arm64
- os: macos-latest
target: x64
- os: windows-latest
Expand Down
11 changes: 6 additions & 5 deletions entab-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ where
Arg::new("metadata")
.short('m')
.long("metadata")
.help("Reports metadata about the file instead of the data itself"),
.help("Reports metadata about the file instead of the data itself")
.action(clap::ArgAction::SetTrue),
)
.try_get_matches_from(args);

Expand Down Expand Up @@ -103,7 +104,7 @@ where
Box::new(stdout)
};

if matches.contains_id("metadata") {
if matches.get_flag("metadata") {
writer.write_all(b"key")?;
writer.write_all(&[params.main_delimiter])?;
writer.write_all(b"value")?;
Expand Down Expand Up @@ -153,19 +154,19 @@ mod tests {
fn test_output() -> Result<(), EtError> {
let mut out = Vec::new();
assert!(run(["entab"], &b">test\nACGT"[..], io::Cursor::new(&mut out)).is_ok());
println!("{}", std::str::from_utf8(&out).unwrap());
assert_eq!(&out[..], b"id\tsequence\ntest\tACGT\n");
Ok(())
}

#[test]
fn test_metadata() -> Result<(), EtError> {
let mut out = Vec::new();
assert!(run(
run(
["entab", "--metadata"],
&b">test\nACGT"[..],
io::Cursor::new(&mut out)
)
.is_ok());
)?;
assert_eq!(&out[..], b"key\tvalue\n");
Ok(())
}
Expand Down

0 comments on commit 7915869

Please sign in to comment.