記事の引越しから漏れていたのでサルベージ。

zsh用のscript/generateおよびscript/destroyの補完関数です。
以下のスクリプトを.zshrcなどに書いておけば、
./script/generateに続けてTABキーを押す事で
generatorの入力を補完できます。

~/.zshrc

shell>>
_generate () {
if [ ! -f .generators ]; then
./script/generate --help | grep '^ [^ ]: ' | sed 's/[^:]:/compadd/' | sed 's/,//g' > .generators
fi
cat .generators
}

compdef _generate generate
compdef _generate destroy
<<--

RubyGems、Plugin、BuildInの3種類のgeneratorを検出して補完します。
検出動作が重いので、カレントディレクトリにキャッシュファイルを作成して
2度目以降の補完を高速化しています。
generatorを追加した場合など、キャッシュを無効化したい場合は

shell>>
$ rm .generators
<<--

でキャッシュファイルを削除してください。

補完が重くても余計なファイルが生成されるよりはマシ、
という場合はこちらをどうぞ。

shell>>
_generate () {
./script/generate --help | grep '^ [^ ]*: ' | sed 's/[^:]*:/compadd/' | sed 's/\,//g'
}

compdef _generate generate
compdef _generate destroy
<<--

誰かが作らないかなあ、と思って待っていたのですが、
なかなか出て来ないので自分で作りました。
もっと良いものがあったら教えていただけると嬉しいです。

posted by genki genki on Mon 26 Nov 2007 at 05:06 with 0 comments
Contents rssrss
光ファイバーを二次元振動させて走査するAR用ディスプレイ
因果の取り違え
Swift2's defer for CoffeeScript
mongodb-3.0からcreateIndexのdropDupsが無くなったらしい
mongodb-3.0以降のWiredTigerの設定を動的に変更する方法
一般楕円の高速生成アルゴリズムへの道標
farro mantecatoのレシピ
Droonga関連の記事のまとめ
RuntimeErrorの特定のメッセージに限定してrescueする方法
jQueryでscriptタグを実行せずにappendする
Tags
coffeescriptdefergroongajsmemonodenodejs
Comments rssrss
https://bisoncasino-hu.com/ https://bisoncasino-hu.com/: You are so cool! I don't believe I have read a s... 04/26 15:49
https://traversi.ru/kz/ https://traversi.ru/kz/: Независимые обзоры и рейтинги букмекерских контор ... 04/26 10:23
https://meros.ir https://meros.ir: وقت بخیر، بنده امروز در حال جستجو تو اینترنت با ... 04/26 09:37
https://businessrost.ru/bitrix/redirect.php?goto=http%3A%2F%2Feximha.ch%2Fblog%2Findex.php%3Fid%3Dz85yj914%26abuse%3D1636 https://businessrost.ru/bitrix/redirect.php?goto=http%3A%2F%2Feximha.ch%2Fblog%2Findex.php%3Fid%3Dz85yj914%26abuse%3D1636: I have to thank you for the efforts you have put ... 04/26 06:43
http://ldm.sakura.ne.jp/balu+bbbs/album/album.cgi?mode=detail&no=210 http://ldm.sakura.ne.jp/balu+bbbs/album/album.cgi?mode=detail&no=210: Aw, this was an incredibly good post. Taking the t... 04/25 18:19
https://www.bigbeargum.com/2019/02/15/ambrose-redmoon/ https://www.bigbeargum.com/2019/02/15/ambrose-redmoon/: Hello would you mind letting me know which hosting... 04/25 17:39
http://zeroken.jp/1978td/album/album.cgi?mode=detail&no=20 http://zeroken.jp/1978td/album/album.cgi?mode=detail&no=20: Asking questions are genuinely fastidious thing if... 04/25 17:26
https://natucci-estetica.com/?attachment_id=1376 https://natucci-estetica.com/?attachment_id=1376: Hello there, You have done a fantastic job. I wi... 04/25 17:05