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]

 

posted on 2010-04-19 20:59  zhtwe  阅读(139)  评论(0)    收藏  举报

导航