/usr/bin/getopt: Difference between revisions

Line 92: Line 92:


==COMPATIBILITY==
==COMPATIBILITY==
      This version of getopt(1) is written to be as compatible as possible to other versions.  Usually you
このバージョンの '''getopt'''(1) は、他のバージョンと可能な限り互換性があるように書かれている。 通常、何も変更することなくこのバージョンと置き換えることができ、いくつかの利点もある。
      can just replace them with this version without any modifications, and with some advantages.


      If the first character of the first parameter of getopt is not a '-', getopt goes into compatibility
getopt の最初のパラメータの最初の文字が '-' でない場合、 getopt は互換モードに入る。 getoptは最初のパラメータを短いオプションの文字列として解釈し、他のすべての引数は解析される。 環境変数'''POSIXLY_CORRECT'''が設定されていない限り、パラメータのシャッフルは行われる(つまり、オプション以外のパラメータはすべて最後に出力される)。
      mode.  It will interpret its first parameter as the string of short options, and all other arguments
      will be parsed.  It will still do parameter shuffling (i.e., all non-option parameters are output at
      the end), unless the environment variable POSIXLY_CORRECT is set.


      The environment variable GETOPT_COMPATIBLE forces getopt into compatibility mode.  Setting both this
環境変数'''GETOPT_COMPATIBLE'''は、getoptを強制的に互換モードにする。 この環境変数と'''POSIXLY_CORRECT'''の両方を設定すると、「難しい」プログラムに対して100%の互換性を提供する。 しかし、通常はどちらも必要ない。
      environment variable and POSIXLY_CORRECT offers 100% compatibility for 'difficultprograms.  Usu‐
      ally, though, neither is needed.


      In compatibility mode, leading '-' and '+' characters in the short options string are ignored.
互換モードでは、短いオプション文字列の先頭の '-' '+' は無視される。


==RETURN CODES==
==RETURN CODES==