Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Generate completions for each multicall binary #216

Merged
merged 1 commit into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,8 +8,15 @@ To publish a new release run `scripts/release` from the project directory.

## [Unreleased]

### Added
- Generate completions for `mdless` (see [GH-216]).

### Fixed
- Include generated shell completions in release artifacts.
- Fix completions for mdcat (see [GH-214] and [GH-216])

[GH-214]: https://github.com/lunaryorn/mdcat/issues/214
[GH-216]: https://github.com/lunaryorn/mdcat/pull/216

## [0.29.0] – 2022-10-21

Expand Down
9 changes: 6 additions & 3 deletions build.rs
Expand Up @@ -18,9 +18,12 @@ fn gen_completions<P: AsRef<Path>>(out_dir: P) -> Result<()> {

let completions = out_dir.as_ref().join("completions");
std::fs::create_dir_all(&completions).expect("Failed to create $OUT_DIR/completions");

for shell in [Shell::Bash, Shell::Zsh, Shell::Fish, Shell::PowerShell] {
generate_to(shell, &mut mdcat::Args::command(), "mdcat", &completions)?;
for program in ["mdcat", "mdless"] {
for shell in [Shell::Bash, Shell::Zsh, Shell::Fish, Shell::PowerShell] {
let mut command = mdcat::Args::command();
let subcommand = command.find_subcommand_mut(program).unwrap();
generate_to(shell, subcommand, program, &completions)?;
}
}

Ok(())
Expand Down