Skip to content

Commit

Permalink
Switch to generating completions at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimian committed Dec 30, 2024
1 parent 0116e82 commit cbfa2c0
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 623 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ jobs:
fi
staging="xh-${{ github.ref_name }}-${{ matrix.job.target }}"
mkdir -p "$staging"/{doc,completions}
mkdir -p "$staging"/doc
cp LICENSE README.md $bin $staging
cp CHANGELOG.md doc/xh.1 "$staging"/doc
cp completions/* "$staging"/completions
if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
7z a "$staging.zip" $staging
Expand Down
7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ anyhow = "1.0.38"
brotli = { version = "3.3.0", default-features = false, features = ["std"] }
chardetng = "0.1.15"
clap = { version = "4.4", features = ["derive", "wrap_help", "string"] }
clap_complete = { version = "4.4", optional = true }
clap_complete = "4.4"
cookie_store = { version = "0.20.0", features = ["preserve_order"] }
digest_auth = "0.3.0"
dirs = "5.0"
Expand Down Expand Up @@ -101,7 +101,7 @@ network-interface = ["dep:network-interface"]

online-tests = []
ipv6-tests = []
man-completion-gen = ["clap_complete", "roff"]
man-gen = ["roff"]

[package.metadata.cross.build.env]
passthrough = ["CARGO_PROFILE_RELEASE_LTO"]
Expand All @@ -118,9 +118,6 @@ assets = [
["README.md", "usr/share/doc/xh/README", "644"],
["doc/xh.1", "usr/share/man/man1/xh.1", "644"],
["assets/xhs.1.gz", "usr/share/man/man1/xhs.1.gz", "777"],
["completions/xh.bash", "usr/share/bash-completion/completions/xh", "644"],
["completions/xh.fish", "usr/share/fish/vendor_completions.d/xh.fish", "644"],
["completions/_xh", "usr/share/zsh/vendor-completions/", "644"],
]
extended-description = """\
xh is a friendly and fast tool for sending HTTP requests.
Expand Down
4 changes: 2 additions & 2 deletions RELEASE-CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
- Update `CHANGELOG.md` (rename unreleased header to the current date, add any missing changes).
- Run `cargo update` to update dependencies.
- Bump up the version in `Cargo.toml` and run `cargo check` to update `Cargo.lock`.
- Run the following to update man pages and shell-completion files.
- Run the following to update man pages.
```sh
cargo run --all-features -- generate-completions completions && cargo run --all-features -- generate-manpages doc
cargo run --all-features -- generate-manpages doc
```
- Commit changes and push them to remote.
- Add git tag e.g `git tag v0.9.0`.
Expand Down
158 changes: 0 additions & 158 deletions completions/_xh

This file was deleted.

Loading

0 comments on commit cbfa2c0

Please sign in to comment.