|
|
Line 1,987: |
Line 1,987: |
|
| |
|
| ;<nowiki>compgen [option] [word]</nowiki> | | ;<nowiki>compgen [option] [word]</nowiki> |
| :Generate possible completion matches for word according to the options, which may be any option accepted by the complete builtin with the exception of -p and -r, and write the matches to the standard output. When using the -F or -C options, the various shell variables set by the programmable completion facilities, while available, will not have useful values. | | :-pと-rを除く、complete組み込み関数が受け付けるどのオプションでもよい。 -F または -C オプションを使用する場合、プログラム可能な補完機能によって設定されるさまざまなシェル変数は使用可能であるが、有用な値を持たない。 |
|
| |
|
| :The matches will be generated in the same way as if the programmable completion code had generated them directly from a completion specification with the same flags. If word is specified, only those completions matching word will be displayed. | | :マッチは、プログラマブル補完コードが同じフラグを持つ補完指定から直接生成したのと同じ方法で生成される。 wordが指定された場合、wordにマッチする補完のみが表示される。 |
|
| |
|
| The return value is true unless an invalid option is supplied, or no matches were generated.
| | :無効なオプションが与えられるか、マッチが生成されない限り、戻り値は真である。 |
|
| |
|
| ;<nowiki>complete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action] [-G globpat] [-W wordlist]</nowiki> | | ;<nowiki>complete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action] [-G globpat] [-W wordlist]</nowiki> |
| :;<nowiki>[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] name [name ...]</nowiki> | | :;<nowiki>[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] name [name ...]</nowiki> |
| ;<nowiki>complete -pr [-DEI] [name ...]</nowiki> | | ;<nowiki>complete -pr [-DEI] [name ...]</nowiki> |
| Specify how arguments to each name should be completed. If the -p option is supplied, or if no options are supplied, existing completion specifications are printed in a way that allows them to be reused as input. The -r option removes a completion specification for each name, or, if no names are supplied, all completion specifications. The -D option indicates that other supplied options and actions should apply to the ``default'' command completion; that is, completion attempted on a command for which no completion has previously been defined. The -E option indicates that other supplied options and actions should apply to ``empty'' command completion; that is, completion attempted on a blank line. The -I option indicates that other supplied options and actions should apply to completion on the initial non-assignment word on the line, or after a command delimiter such as ; or |, which is usually command name completion. If multiple options are supplied, the -D option takes precedence over -E, and both take precedence over -I. If any of -D, -E, or -I are supplied, any other name arguments are ignored; these completions only apply to the case specified by the option.
| | :各名前に対する引数をどのように補完するかを指定する。 -pオプションが与えられている場合、またはオプションが与えられていない場合、既存の補完指定が入力として再利用できるような形で出力される。 rオプションは、各名前の補完指定を削除し、名前が与えられていない場合は、すべての補完指定を削除する。 -Dオプションは、他のオプションやアクションが``default''コマンドの 補完に適用されることを示す。 -Eオプションは他のオプションやアクションが``empty''コマンド補完に適用されることを示す。 -Iオプションは、他のオプションやアクションが、その行の最初の非割り当ての単語、またはコマンドの区切り文字(;や|など)の後の補完に適用されることを示す。 複数のオプションが指定された場合、-Dオプションは-Eよりも優先され、両者は-Iよりも優先される。 -D、-E、-Iのいずれかを指定すると、他の名前引数は無視される。 |
|
| |
|
| The process of applying these completion specifications when word completion is attempted is described above under Programmable Completion.
| | :これらの補完は、オプションで指定された場合にのみ適用される。単語補完が試みられたときにこれらの補完指定を適用する処理については、上記の「プログラム可能な補完」で説明されている。 |
|
| |
|
| Other options, if specified, have the following meanings. The arguments to the -G, -W, and -X options (and, if necessary, the -P and -S options) should be quoted to protect them from expansion before the complete builtin is invoked.
| | :その他のオプションが指定されている場合は、以下の意味を持つ。 G、-W、-Xオプションの引数(必要であれば-Pと-Sオプションも) は、組み込み関数が起動する前に展開されないように引用符で囲む。 |
| :;-o comp-option | | :;-o comp-option |
| ::The comp-option controls several aspects of the compspec's behavior beyond the simple generation of completions. comp-option may be one of: | | ::comp-optionは、単純な補完の生成だけでなく、compspecの動作のいくつかの側面を制御する: |
| :::bashdefault | | :::bashdefault |
| ::::Perform the rest of the default bash completions if the compspec generates no matches. | | ::::compspecがマッチを生成しなかった場合、残りのデフォルトのbash補完を実行する。 |
| :::default | | :::default |
| ::::Use readline's default filename completion if the compspec generates no matches. | | ::::compspecがマッチを生成しない場合、readlineのデフォルトのファイル名補完を使用する。 |
| :::dirnames | | :::dirnames |
| ::::Perform directory name completion if the compspec generates no matches. | | ::::compspecがマッチを生成しない場合、ディレクトリ名の補完を行う。 |
| :::filenames | | :::filenames |
| ::::Tell readline that the compspec generates filenames, so it can perform any filename-specific processing (like adding a slash to directory names, quoting special characters, or suppressing trailing spaces). Intended to be used with shell functions. | | ::::readlineに、compspecがファイル名を生成することを伝え、ファイル名固有の処理(ディレクトリ名にスラッシュを追加したり、特殊文字を引用したり、末尾の空白を抑えたり)を実行できるようにする。 シェル関数と一緒に使うことを意図している。 |
| :::noquote | | :::noquote |
| ::::Tell readline not to quote the completed words if they are filenames (quoting filenames is the default). | | ::::readlineに、完了した単語がファイル名の場合は引用しないように指示する(ファイル名を引用するのがデフォルト)。 |
| :::nosort | | :::nosort |
| ::::Tell readline not to sort the list of possible completions alphabetically. | | ::::readlineに、補完可能リストをアルファベット順に並べ替えないように指示する。 |
| :::nospace | | :::nospace |
| ::::Tell readline not to append a space (the default) to words completed at the end of the line. | | ::::readlineに、行末で完了した単語にスペース(デフォルト)を追加しないように指示する。 |
| :::plusdirs | | :::plusdirs |
| ::::After any matches defined by the compspec are generated, directory name completion is attempted and any matches are added to the results of the other actions. | | ::::compspecで定義されたマッチが生成された後、ディレクトリ名の補完が試みられ、マッチしたものは他のアクションの結果に追加される。 |
| :;-A action | | :;-A action |
| ::The action may be one of the following to generate a list of possible completions: | | ::アクションは以下のいずれかであり、可能性のある完了のリストを生成する: |
| :::alias | | :::alias |
| ::::Alias names. May also be specified as -a. | | ::::エイリアス名。 -aとして指定することもできる。 |
| :::arrayvar | | :::arrayvar |
| ::::Array variable names. | | ::::配列変数名。 |
| :::binding | | :::binding |
| ::::Readline key binding names. | | ::::キーバインディング名を読み込む。 |
| :::builtin | | :::builtin |
| ::::Names of shell builtin commands. May also be specified as -b. | | ::::シェル組み込みコマンドの名前。 -bとしても指定できる。 |
| :::command | | :::command |
| ::::Command names. May also be specified as -c. | | ::::コマンド名。 -cとしても指定できる。 |
| :::directory | | :::directory |
| ::::Directory names. May also be specified as -d. | | ::::ディレクトリ名。 dとしても指定できる。 |
| :::disabled | | :::disabled |
| ::::Names of disabled shell builtins. | | ::::無効化されたシェルビルトインの名前。 |
| :::enabled | | :::enabled |
| ::::Names of enabled shell builtins. | | ::::使用可能なシェルビルトインの名前。 |
| :::export | | :::export |
| ::::Names of exported shell variables. May also be specified as -e. | | ::::エクスポートされるシェル変数の名前。 -e として指定することもできる。 |
| :::file | | :::file |
| ::::File names. May also be specified as -f. | | ::::ファイル名。 -fを指定することもできる。 |
| :::function | | :::function |
| ::::Names of shell functions. | | ::::シェル関数の名前。 |
| :::group | | :::group |
| ::::Group names. May also be specified as -g. | | ::::グループ名。 -gとしても指定できる。 |
| :::helptopic | | :::helptopic |
| ::::Help topics as accepted by the help builtin. | | ::::helpビルトインが受け付けるヘルプトピック。 |
| :::hostname | | :::hostname |
| ::::Hostnames, as taken from the file specified by the HOSTFILE shell variable. | | ::::HOSTFILEシェル変数で指定されたファイルから取られたホスト名。 |
| :::job | | :::job |
| ::::Job names, if job control is active. May also be specified as -j. | | ::::ジョブ制御が有効な場合は、ジョブ名。 -jとしても指定できる。 |
| :::keyword | | :::keyword |
| ::::Shell reserved words. May also be specified as -k. | | ::::シェル予約語。 -kとしても指定できる。 |
| :::running | | :::running |
| ::::Names of running jobs, if job control is active. | | ::::ジョブ制御が有効な場合、実行中のジョブの名前。 |
| :::service | | :::service |
| ::::Service names. May also be specified as -s. | | ::::サービス名。 -sとしても指定できる。 |
| :::setopt | | :::setopt |
| ::::Valid arguments for the -o option to the set builtin. | | ::::set 組み込み関数に対する -o オプションの有効な引数。 |
| :::shopt | | :::shopt |
| ::::Shell option names as accepted by the shopt builtin. | | ::::shopt 組み込み関数が受け付けるシェルオプション名。 |
| :::signal | | :::signal |
| ::::Signal names. | | ::::シグナルの名前。 |
| :::stopped | | :::stopped |
| ::::Names of stopped jobs, if job control is active. | | ::::ジョブ制御が有効な場合、停止しているジョブの名前。 |
| :::user | | :::user |
| ::::User names. May also be specified as -u. | | ::::ユーザー名。 -uとしても指定できる。 |
| :::variable | | :::variable |
| ::::Names of all shell variables. May also be specified as -v. | | ::::すべてのシェル変数の名前。 v として指定することもできる。 |
| :;-C command | | :;-C command |
| ::command is executed in a subshell environment, and its output is used as the possible completions. | | ::コマンドはサブシェル環境で実行され、その出力が可能な補完として使われる。 |
| :;-F function | | :;-F function |
| ::The shell function function is executed in the current shell environment. When the function is executed, the first argument ($1) is the name of the command whose arguments are being completed, the second argument ($2) is the word being completed, and the third argument ($3) is the word preceding the word being completed on the current command line. When it finishes, the possible completions are retrieved from the value of the COMPREPLY array variable. | | ::シェル関数関数は、現在のシェル環境で実行される。 この関数が実行されると、第1引数($1)は補完される引数のコマンド名、第2引数($2)は補完される単語、第3引数($3)は現在のコマンド行で補完される単語の前の単語である。 終了すると、COMPREPLY配列変数の値から可能な補完が検索される。 |
| :;-G globpat | | :;-G globpat |
| ::The pathname expansion pattern globpat is expanded to generate the possible completions. | | ::パス名展開パターンglobpatが展開され、可能な補完が生成される。 |
| :;-P prefix | | :;-P prefix |
| ::prefix is added at the beginning of each possible completion after all other options have been applied. | | ::接頭辞は、他のすべてのオプションが適用された後、各完了候補の先頭に追加される。 |
| :;-S suffix | | :;-S suffix |
| ::suffix is appended to each possible completion after all other options have been applied. | | ::サフィックスは、他のすべてのオプションが適用された後、各完了可能なものに付加される。 |
| :;-W wordlist | | :;-W wordlist |
| ::The wordlist is split using the characters in the IFS special variable as delimiters, and each resultant word is expanded. Shell quoting is honored within wordlist, in order to provide a mechanism for the words to contain shell metacharacters or characters in the value of IFS. The possible completions are the members of the resultant list which match the word being completed. | | ::ワードリストは特殊変数IFSの文字を区切り文字として分割され、各単語が展開される。 単語の中にシェルのメタ文字やIFSの値に含まれる文字があってもよいように、単語リスト内ではシェル引用符で囲む。 可能な補完は、補完される単語にマッチする結果リストのメンバーである。 |
| :;-X filterpat | | :;-X filterpat |
| ::filterpat is a pattern as used for pathname expansion. It is applied to the list of possible completions generated by the preceding options and arguments, and each completion matching filterpat is removed from the list. A leading ! in filterpat negates the pattern; in this case, any completion not matching filterpat is removed. | | ::filterpatはパス名展開に使われるパターンである。 これは、直前のオプションと引数で生成された補完候補のリストに適用され、 filterpatにマッチする補完がリストから取り除かれる。 filterpat の先頭の ! はパターンを否定する。この場合、 filterpat にマッチしない補完はすべて取り除かれる。 |
|
| |
|
| :The return value is true unless an invalid option is supplied, an option other than -p or -r is supplied without a name argument, an attempt is made to remove a completion specification for a name for which no specification exists, or an error occurs adding a completion specification. | | :無効なオプションが指定された場合、-pまたは-r以外のオプションが name引数なしで指定された場合、指定が存在しない名前の補完指定を削除しようとした場合、または補完指定の追加エラーが発生した場合を除き、戻り値は真である。 |
|
| |
|
| ;<nowiki>compopt [-o option] [-DEI] [+o option] [name]</nowiki> | | ;<nowiki>compopt [-o option] [-DEI] [+o option] [name]</nowiki> |
| :Modify completion options for each name according to the options, or for the currently-executing completion if no names are supplied. If no options are given, display the completion options for each name or the current completion. The possible values of option are those valid for the complete builtin described above. The -D option indicates that other supplied options should apply to the ``default'' command completion; that is, completion attempted on a command for which no completion has previously been defined. The -E option indicates that other supplied options should apply to ``empty'' command completion; that is, completion attempted on a blank line. The -I option indicates that other supplied options should apply to completion on the initial non-assignment word on the line, or after a command delimiter such as ; or |, which is usually command name completion. | | :オプションにしたがって各名称の補完オプションを変更するか、名前が与えられていない場合は現在実行中の補完オプションを変更する。 オプションが与えられない場合は、各名前または現在実行中の補完の補完オプションを表示する。 optionに指定できる値は、前述の完全組み込み関数で有効な値である。 Dオプションは、他のオプションが ``デフォルト'' コマンド補完に適用されることを示す。 Eオプションは、他のオプションが``empty''コマンド補完に適用される ことを示す。 Iオプションは、他のオプションが、その行の最初の非割り当ての単語、またはコマンドの区切り文字である;や|の後の補完に適用されることを示す。 |
|
| |
|
| :The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a name for which no completion specification exists, or an output error occurs. | | :無効なオプションが与えられるか、補完指定が存在しない名前のオプションを変更しようとするか、出力エラーが発生しない限り、戻り値は真である。 |
|
| |
|
| ;<nowiki>continue [n]</nowiki> | | ;<nowiki>continue [n]</nowiki> |