getopt under Linux

 

> ./getoptdemo -ab arg1 -dc

 

 

-ab arg1 -dc

result for ":ab:c:":
optind=01 -a
optind=03 -b arg1
optind=03 -d [unknown option]
optind=04 -c [need an argument]

result for "ab:c:":
optind=01 -a
optind=03 -b arg1
optind=03 -d [unknown option]
optind=04 -c [unknown option]

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章