日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

gnu.getopt java_c – 用于GNU getopt()的-W选项是什么?

發布時間:2024/9/27 64 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gnu.getopt java_c – 用于GNU getopt()的-W选项是什么? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

The -W (capital-W) option shall be reserved for vendor options.

If optstring contains W followed by a semicolon ( ; ), then -W foo is treated as the long option --foo. (The -W option is reserved by POSIX.2 for implementation extensions.)

有人能夠以更清晰的方式解釋上述句子(直截了當)并解釋為什么這樣的選項有用嗎?

上面的語句讓我感到困惑,因為我認為getopt(不是getopt_long,getopt_long_only)只能理解短選項.

解決方法:

Long options can also be specified using a special POSIX argument

format (one that I highly discourage). This form of entry is enabled

by placing a “W;” (yes, ‘W’ then a semi-colon) in the valid option

string. This causes getopt to treat the name following the “-W” as the

name of the long option. For example, “-W outputdir=foo” would be

equivalent to “–outputdir=foo”. The name can immediately follow the

“-W” like so: “-Woutputdir=foo”. Option arguments are handled

identically to normal long options. If a string follows the “-W” that

does not represent a valid long option, then getopt() returns ‘W’ and

the caller must decide what to do. Otherwise getopt() returns a long

option value as described below.

標簽:c-3,linux,unix,command-line

來源: https://codeday.me/bug/20190729/1569495.html

總結

以上是生活随笔為你收集整理的gnu.getopt java_c – 用于GNU getopt()的-W选项是什么?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。