「Fishの基礎 - 補完」の版間の差分

ナビゲーションに移動 検索に移動
257行目: 257行目:
*: <syntaxhighlight lang="fish">complete -c openfile -f -a "(__fish_complete_suffix .txt)"</syntaxhighlight>
*: <syntaxhighlight lang="fish">complete -c openfile -f -a "(__fish_complete_suffix .txt)"</syntaxhighlight>
*: <br>
*: <br>
* <code>__fish_complete_history</code>
*: コマンド履歴から項目を補完する。
* <code>__fish_print_hostnames</code>
* <code>__fish_print_hostnames</code>
*: <u>/etc/hosts</u>ファイルとmDNSから取得したホスト名を補完する。
*: <u>/etc/hosts</u>ファイルとmDNSから取得したホスト名を補完する。
264行目: 262行目:
*: 以下の例では、some_commandコマンドに対して、システムが知りうるホスト名を補完候補として提供している。
*: 以下の例では、some_commandコマンドに対して、システムが知りうるホスト名を補完候補として提供している。
*: <syntaxhighlight lang="fish">complete -c some_command -f -a "(__fish_print_hostnames)"</syntaxhighlight>
*: <syntaxhighlight lang="fish">complete -c some_command -f -a "(__fish_print_hostnames)"</syntaxhighlight>
*: <br>
* <code>__fish_complete_history</code>
*: コマンド履歴から項目を補完する。
*: <br>
*: 以下の例では、rerunコマンドに対して、過去に実行したコマンドを補完候補として提供している。
*: <syntaxhighlight lang="fish">complete -c rerun -f -a "(__fish_complete_history)"</syntaxhighlight>
*: <br>
*: <br>
* <code>__fish_print_interfaces</code>
* <code>__fish_print_interfaces</code>
*: システムのネットワークインターフェースを補完する。
*: システムのネットワークインターフェースを補完する。
*: <br>
*: 以下の例では、ifconfigコマンドに対して、利用可能なネットワークインターフェース (例: eth0, wlan0等) を補完候補として提供している。
*: <syntaxhighlight lang="fish">complete -c ifconfig -f -a "(__fish_print_interfaces)"</syntaxhighlight>
*: <br>
* <code>__fish_print_filesystems</code>
* <code>__fish_print_filesystems</code>
*: 利用可能なファイルシステムタイプを補完する。
*: システムでサポートされているファイルシステムの一覧を補完する。
*: <br>
*: 以下の例では、mountコマンドに対して、利用可能なファイルシステムタイプ (例: ext4, ntfs, vfat等) を補完候補として提供している。
*: <syntaxhighlight lang="fish">complete -c mount -f -a "(__fish_print_filesystems)"</syntaxhighlight>
*: <br>
* <code>__fish_print_packages</code>
* <code>__fish_print_packages</code>
*: システムのパッケージマネージャーからパッケージ名を補完する。
*: パッケージ管理システムからインストールされたパッケージの一覧を補完する。
*: <br>
*: 以下の例では、zepper removeコマンドに対して、インストール済みのパッケージ名を補完候補として提供している。
*: <syntaxhighlight lang="fish">complete -c apt-get -f -n "__fish_seen_subcommand_from remove" -a "(__fish_print_packages)"</syntaxhighlight>
*: <br>
* <code>__fish_complete_uninstalled_packages</code>
*: システムにインストールされていないが利用可能なパッケージの一覧を補完する。
*: <br>
*: 以下の例では、zypper installコマンドに対して、インストールされていない利用可能なパッケージ名を補完候補として提供している。
*: <syntaxhighlight lang="fish">complete -c apt-get -f -n "__fish_seen_subcommand_from install" -a "(__fish_complete_uninstalled_packages)"</syntaxhighlight>
*: <br>
* <code>__fish_complete_man</code>
* <code>__fish_complete_man</code>
*: manページの名前を補完する。
*: manページの名前を補完する。
* <code>__fish_complete_time</code>
* <code>__fish_complete_time</code>
*: 時間関連の補完を提供する。
*: 時間関連の補完を提供する。
* <code>__fish_complete_uninstalled_packages</code>
*: インストールされていないパッケージを補完する。
* <code>__fish_apropos</code>
* <code>__fish_apropos</code>
*: aproposコマンドの結果を基に補完候補を生成する。
*: aproposコマンドの結果を基に補完候補を生成する。

案内メニュー