2
等号の後にパスを自動補完するbash補完スクリプトを作成しますか?
フォーム--argとの引数を認識するbash補完スクリプトを作成したいと思います--some-arg=file。 このチュートリアルといくつかの例を読んだ後/usr/share/bash_completion/completions/、次のスクリプトを作成しました(Chromiumでいくつかのフラグを入力する時間を節約するため)。 _chromium() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # Some interesting options opts=" --disable-web-security --easy-off-store-extension-install --incognito --load-extension= --pack-extension= --pack-extension-key= --user-data-dir= " # Handle --xxxxxx=file if [[ ${cur} == "--"*"=" ]] ; then # Removed failures (is my logic OK?) return 0 fi # Handle other options if …