Inspired by a very insightful post by @dlakelan I'm finally getting around to asking about a CLI issue I'm having.

Apparently xmms2 doesn't have tab completion out of the box. My distro is Mint 22.1. So far I figured out that I need to add a text file for it to /usr/share/bash-completion/completions/. Weirdly there's already one for regular xmms. So I found one at:

https://gist.github.com/ektich/3702fd8206e3a5ba6aff14566032d6e9

And added it to the directory but still no luck. I feel like I'm missing something basic but what is it??

#Linux #xmms2 #BashCompletion #BASH #CLI

https://mastodon.sdf.org/@dlakelan/116275965540442423

TIL: do not set BASH_COMPLETION_COMPAT_DIR and instead place your #bash completion files in ~/.local/share/bash-completion/completions/ to load them lazily.

#completion #bashcompletion

Управление сервером со смартфона

Из любого SSH-клиента можно установить канал с сервером и управлять им стандартными командами в консоли. Есть такие клиенты и для смартфона. Многие знают и используют консоль Termux под Android, которая запускает с телефона стандартный OpenSSH. Но есть варианты ещё удобнее, даже с графическим интерфейсом.

https://habr.com/ru/companies/ruvds/articles/824352/

#ruvds_статьи #RebootX_OnPrem #RebootX #Amazon_Web_Services #AWS #Microsoft_Azure #Clever_Cloud #Google_Cloud #GCP #OVH #Scaleway #Grafana #OpenAPI_Specification #SwaggerUI #Docker_Compose #swellsh #Bash #Tmux #Termux #bashcompletion #Webmin

Управление сервером со смартфона

Из любого SSH-клиента можно установить канал с сервером и управлять им стандартными командами в консоли. Есть такие клиенты и для смартфона. Многие знают и используют консоль Termux под Android,...

Хабр
Released command_kit-completion 0.2.0 with minor improvements to how it automatically identifies types of arguments.
https://github.com/postmodern/command_kit-completion/releases/tag/v0.2.0
https://github.com/postmodern/command_kit-completion#readne
#ruby #cli #command_kit #bashcompletion
Release 0.2.0 · postmodern/command_kit-completion

Also generate completion rules for option's short flags. Also generate <file>, <directory>, <hostname>, and <user> completion rules for options who's value is named FILE, DIR, HOST, USER (or ends i...

GitHub
TIL Fedora's bash completion rules for `nc` / `netcat` uses the bash completion function `_known_hosts_real` which lists all hosts from ssh's known_hosts file(s) and `avahi-browse`.
#bashcompletion #fedora
Released command_kit 0.5.0 which adds the CommandKit::Completion::Install module for installing bash, zsh, or fish shell completion files.
https://github.com/postmodern/command_kit.rb/releases/tag/v0.5.0
#ruby #cli #bashcompletion #command_kit #commandkit #bash #zsh #fishshell
Release 0.5.0 · postmodern/command_kit.rb

Added CommandKit::Env::Shell. Added CommandKit::Env::Prefix. Added CommandKit::Completion::Install.

GitHub

Ah ha, I figured out how to load bash completions into zsh:

1. The completion file name must start with with a `_` character.
2. The completion file must be installed into `/usr/local/share/zsh/site-functions/`.
3. The completion file must start with the lines `#compdef command-name-here`.
4. You must enable and call the `compinit` and `bashcompinit` modules/commands in your `~/.zshrc`.

If any of those things are missing, the completions won't load/work.
#zsh #bashcompletion

What would be a good defacto directory for gems to store their shell completion files?
#ruby #shellcompletion #bashcompletion #rubygems
completions
45.5%
completions.d
27.3%
data/completions
0%
data/completions.d
27.3%
Poll ended at .
Released command_kit-completion 0.1.0. Automatically generates shell completion rules for a command_kit CLI app.
https://github.com/postmodern/command_kit-completion#readme
#ruby #command_kit #bashcompletion #shellcompletion #cli
GitHub - postmodern/command_kit-completion: Generate shell completions for command_kit commands

Generate shell completions for command_kit commands - GitHub - postmodern/command_kit-completion: Generate shell completions for command_kit commands

GitHub

How would/should a Ruby CLI install it's own custom shell completion rules? A global option that prints the completion script out? A global option that attempts to install the completion script into the correct shell directory, based on shell and whether the user is root or not. Or maybe a sub-command that prints and/or installs the shell completion script?

I kind of wish rubygems had support for installing custom completion rules.
#ruby #shellcompletion #bashcompletion