[PR #523] [CLOSED] Add shell completions by shtab #1111

Closed
opened 2026-03-15 11:19:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/523
Author: @Freed-Wu
Created: 9/17/2022
Status: Closed

Base: mainHead: develop


📝 Commits (1)

  • a4bfe0f Add shell completions by shtab

📊 Changes

3 files changed (+37 additions, -6 deletions)

View changed files

📝 asciinema/__main__.py (+19 -6)
asciinema/_shtab.py (+14 -0)
📝 setup.cfg (+4 -0)

📄 Description

asciinema --print-completion bash | sudo tee /usr/share/bash-completion/completions/asciinema
asciinema --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_asciinema
asciinema --print-completion tcsh | sudo tee /etc/profile.d/asciinema.completion.csh
❯ asciinema <TAB>
asciinema commands
auth
cat
play
rec
upload
❯ asciinema play --<TAB>
option
--help              show this help message and exit
--idle-time-limit   limit idle time during playback to given number of seconds
--loop              loop loop loop loop
--out-fmt           select output format
--speed             set playback speed (can be fractional)
--stream            select stream to play
❯ asciinema play --out-fmt <TAB>
out_fmt
asciicast  raw

It should can replace
https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_asciinema.
Because this PR is generated from argparse automatically. But the latter is
written manually.

I use some type:ignore. It is not elegant. Does any better method exist?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/523 **Author:** [@Freed-Wu](https://github.com/Freed-Wu) **Created:** 9/17/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `develop` --- ### 📝 Commits (1) - [`a4bfe0f`](https://github.com/asciinema/asciinema/commit/a4bfe0fcb92baf18cd2c6c3a42c0380569f8d985) Add shell completions by shtab ### 📊 Changes **3 files changed** (+37 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `asciinema/__main__.py` (+19 -6) ➕ `asciinema/_shtab.py` (+14 -0) 📝 `setup.cfg` (+4 -0) </details> ### 📄 Description ```sh asciinema --print-completion bash | sudo tee /usr/share/bash-completion/completions/asciinema asciinema --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_asciinema asciinema --print-completion tcsh | sudo tee /etc/profile.d/asciinema.completion.csh ``` ```sh ❯ asciinema <TAB> asciinema commands auth cat play rec upload ❯ asciinema play --<TAB> option --help show this help message and exit --idle-time-limit limit idle time during playback to given number of seconds --loop loop loop loop loop --out-fmt select output format --speed set playback speed (can be fractional) --stream select stream to play ❯ asciinema play --out-fmt <TAB> out_fmt asciicast raw ``` It should can replace <https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_asciinema>. Because this PR is generated from argparse automatically. But the latter is written manually. I use some `type:ignore`. It is not elegant. Does any better method exist? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:19:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#1111
No description provided.