开发者

KornShell script command line option

I want a command line option like this one in the following KornShell (ksh) script. I know we ca开发者_开发问答n use getopts for single hypen. What is the beast way to use both command line option?

script  [-u|--upload] [-r|--run] [-d|--diskinfo]


getopts -l, --longoptions longopts

The long (multi-character) options to be recognised. More than one option name may be specified at once, by separating the names with commas. This option may be given more than once, the longopts are cumulative. Each long option name in longopts may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜