getopt . more on parse command options

commandline session

$getopt hello
 --
$getopt helloo
 --
$getopt hellooo
 --
$getopt hellooo how
 -- how
$getopt hellooo how are
 -- how are
$getopt h how are
 -- how are
$getopt h h h
 -- h h
$getopt ab -a
 -a --
$getopt ab -ab
 -a -b --
$getopt ab -ab -R
getopt: invalid option -- 'R'
 -a -b --
$getopt ab -ab -l
getopt: invalid option -- 'l'
 -a -b --
$getopt ab -abl
getopt: invalid option -- 'l'
 -a -b --
$getopt ab -abn
getopt: invalid option -- 'n'
 -a -b --
$getopt ab -abc
getopt: invalid option -- 'c'
 -a -b --
$getopt nl -nl
 -n -l --
$getopt R -nl
getopt: invalid option -- 'n'
getopt: invalid option -- 'l'
 --
$getopt R -R
 -R --
$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s