Skip to content

Commit

Permalink
Disable manpage generation on github
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanarijit committed May 20, 2023
1 parent 3aeca36 commit 862f352
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion assets/jf.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.\" Text automatically generated by txt2man
.TH jf "1" "" ""

.SH USAGE

jf TEMPLATE [VALUE]\.\.\. [NAME=VALUE]\.\.\.
Expand Down
3 changes: 1 addition & 2 deletions assets/jf.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

USAGE

jf TEMPLATE [VALUE]... [NAME=VALUE]...
Expand Down Expand Up @@ -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%"}
3 changes: 2 additions & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 862f352

Please sign in to comment.