「シェルパッケージガイドライン」の版間の差分
ナビゲーションに移動
検索に移動
(英語版から転載) |
(相違点なし)
|
2022年2月22日 (火) 22:39時点における版
関連記事
パッケージ作成ガイドライン
32ビット – CLR – クロス – Eclipse – Electron – Free Pascal – GNOME – Go – Haskell – Java – KDE – カーネル – Lisp – MinGW – Node.js – ノンフリー – OCaml – Perl – PHP – Python – R – Ruby – Rust – VCS – ウェブ – Wine
Install
For users to change shells, the shell must appear in /etc/shells
. Most shell packages have install scripts like below:
shellname.install
post_install() { grep -Fqx /bin/shellname /etc/shells || echo /bin/shellname >>/etc/shells grep -Fqx /usr/bin/shellname /etc/shells || echo /usr/bin/shellname >>/etc/shells } post_upgrade() { post_install } post_remove() { sed -i -r '/^(\/usr)?\/bin\/shellname$/d' etc/shells }
Shell completions
Most shells provide a built in set of completions for a few common commands while also scanning at least one system directory for functions that may be supplied by other packages. The following table is a summary of where packages may place completion files and what the files should be named.
Shell | Directory | File |
---|---|---|
Bash | /usr/share/bash-completion/completions |
binary_name
|
fish | /usr/share/fish/vendor_completions.d |
binary_name.fish
|
Zsh | /usr/share/zsh/site-functions |
_binary_name
|
Other shells:
- Elvish provides some default completions, but does not have a system-wide directory where completions can be provided yet[1]. For packages that generate Elvish shell completion functions, one solution would be to package them
/usr/share/elvish/completions/binary_name.elv
and use apost_install()
function to print a tip for users to symlink it to their$XDG_CONFIG_HOME/elvish/lib/
directory.