mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 16:05:52 +03:00
[GH-ISSUE #628] Generate shell completions #323
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#323
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alerque on GitHub (Apr 24, 2024).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/628
I just started playing around with updating the Arch Linux packaging in preparation for the v3 release.
Given that the Rust rewrite is using Clap, it should be pretty trivial to generate shell completions for Bash, Zsh, Fish, Elvish, and Powershell should be pretty trivial using clap_completions. This is a nice user convenience to have and makes the most sense in the context of distro packages where they would get automatically installed to the right places automatically.
There is not reason this has to make the final v3 cut, but I figured whether early or late a tracking issue is warranted so downstream packages know if it is or isn't available and how it is generated.
@ku1ik commented on GitHub (Apr 24, 2024):
As I also mentioned in #627 I plan to add this soon 👍
I see clap_complete supports generation both at compile-time and run-time, so we have options here as wells. Initially I thought runtime generation would be most useful, especially for people who download standalone precompiled binaries. Runtime generation can also be used to generate completion files for packages (by redirecting the output to completion files in proper paths within a package dir tree). Although, we could have both, doesn't seem too hard.
Thoughts?
@alerque commented on GitHub (Apr 24, 2024):
Again, personally I much prefer build-time for this, but both ways have pros and cons.
@ku1ik commented on GitHub (Apr 29, 2024):
You can now generate shell completions during build by setting
ASCIINEMA_GEN_DIRenv var - the files will be saved in$ASCIINEMA_GEN_DIR/completion/.@qianbinbin commented on GitHub (Jul 29, 2025):
Sorry for the interruption, I personally hope users can get man pages and shell completions without compiling.
There are several ways:
asciinema completion bash|zsh|fish