From 636daf15cb22bfe13be32efc8c13c1d2b8f94318 Mon Sep 17 00:00:00 2001 From: Roderick Date: Thu, 27 Jun 2024 21:32:16 -0700 Subject: [PATCH] Fix CLI bug and push v0.3.3 --- .github/workflows/publish.yml | 2 -- entab-cli/Cargo.toml | 2 +- entab-cli/src/lib.rs | 11 ++++++----- entab-js/Cargo.toml | 2 +- entab-py/Cargo.toml | 2 +- entab-r/Cargo.toml | 2 +- entab/Cargo.toml | 2 +- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 17edc4d..23cab8a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,8 +33,6 @@ jobs: include: - os: ubuntu-latest target: x86_64 - - os: ubuntu-latest - target: armv7 - os: macos-latest target: x64 - os: windows-latest diff --git a/entab-cli/Cargo.toml b/entab-cli/Cargo.toml index 31404c6..e2bd0d5 100644 --- a/entab-cli/Cargo.toml +++ b/entab-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entab-cli" -version = "0.3.2" +version = "0.3.3" authors = ["Roderick "] edition = "2018" description = "Record-format file reader CLI" diff --git a/entab-cli/src/lib.rs b/entab-cli/src/lib.rs index 151ef9f..f0b76d5 100644 --- a/entab-cli/src/lib.rs +++ b/entab-cli/src/lib.rs @@ -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); @@ -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")?; @@ -153,6 +154,7 @@ 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(()) } @@ -160,12 +162,11 @@ mod tests { #[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(()) } diff --git a/entab-js/Cargo.toml b/entab-js/Cargo.toml index 02d0459..19d66be 100644 --- a/entab-js/Cargo.toml +++ b/entab-js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entab-js" -version = "0.3.2" +version = "0.3.3" authors = ["Roderick "] license = "MIT" description = "Record-format file reader" diff --git a/entab-py/Cargo.toml b/entab-py/Cargo.toml index bf1f892..b0f704c 100644 --- a/entab-py/Cargo.toml +++ b/entab-py/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entab-py" -version = "0.3.2" +version = "0.3.3" authors = ["Roderick "] license = "MIT" description = "Record-format file reader" diff --git a/entab-r/Cargo.toml b/entab-r/Cargo.toml index bcf9875..cb9c203 100644 --- a/entab-r/Cargo.toml +++ b/entab-r/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entab-r" -version = "0.3.2" +version = "0.3.3" authors = ["Roderick "] edition = "2018" diff --git a/entab/Cargo.toml b/entab/Cargo.toml index 5917209..f824589 100644 --- a/entab/Cargo.toml +++ b/entab/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entab" -version = "0.3.2" +version = "0.3.3" authors = ["Roderick "] edition = "2018" description = "Record-format file reader"