From 862f35233d5e5e397998cdee4e5626bfcfea78c4 Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Sat, 20 May 2023 18:45:28 +0530 Subject: [PATCH] Disable manpage generation on github --- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++++ assets/jf.1 | 1 - assets/jf.txt | 3 +-- src/tests.rs | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fade80..7836537 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test --verbose + run: cargo test --verbose --no-default-features - name: Run lint run: cargo clippy --verbose - name: Run fmt diff --git a/Cargo.toml b/Cargo.toml index 177e271..cdba9e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,3 +21,7 @@ strip = true codegen-units = 1 lto = true panic = 'abort' + +[features] +default = ["manpage"] +manpage = [] # This is a dummy feature, just to toggle manpage generation diff --git a/assets/jf.1 b/assets/jf.1 index 3b6b988..9a3a18c 100644 --- a/assets/jf.1 +++ b/assets/jf.1 @@ -1,6 +1,5 @@ .\" Text automatically generated by txt2man .TH jf "1" "" "" - .SH USAGE jf TEMPLATE [VALUE]\.\.\. [NAME=VALUE]\.\.\. diff --git a/assets/jf.txt b/assets/jf.txt index 8953c3a..8f64404 100644 --- a/assets/jf.txt +++ b/assets/jf.txt @@ -1,4 +1,3 @@ - USAGE jf TEMPLATE [VALUE]... [NAME=VALUE]... @@ -50,4 +49,4 @@ EXAMPLES # {"str_or_bool":"true","optional":null} jf '{1: %s, two: %q, 3: %(3)s, four: %(four=4)q, "%%": %(pct)q}' 1 2 3=3 pct=100% - # {"1":1,"two":"2","3":3,"four":"4","%":"100%"} + # {"1":1,"two":"2","3":3,"four":"4","%":"100%"} \ No newline at end of file diff --git a/src/tests.rs b/src/tests.rs index 2814902..e0d4c82 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -340,9 +340,10 @@ fn test_print_version() { ); } +#[cfg(feature = "manpage")] #[test] fn update_manpage() { - std::fs::write("assets/jf.txt", jf::USAGE).unwrap(); + std::fs::write("assets/jf.txt", jf::USAGE.trim()).unwrap(); let man = std::process::Command::new("txt2man") .arg("-P") .arg("jf")