program demo9
!> @(#) long and short names using --LONGNAME:SHORTNAME!!!! When all keys have a long and short name and "strict mode" is invoked!! where "-" is required for short names and "--" for long names Boolean!! values may be bundled together. For example:!!!! demo9 -XYZ!!use M_CLI2, only : set_args, sget, rget, lget, set_mode
implicitnonecharacter(len=*),parameter :: all='(*(g0))'print *,'demo9: long and short names using --LONGNAME:SHORTNAME'!call set_mode('strict')call set_args(' &
& --length:l 10 &
& --height:h 12.45 &
& --switchX:X F &
& --switchY:Y F &
& --switchZ:Z F &
& --title:T "my title"')
printall,'--length or -l .... ',rget('length')
printall,'--height or -h .... ',rget('height')
printall,'--switchX or -X ... ',lget('switchX')
printall,'--switchY or -Y ... ',lget('switchY')
printall,'--switchZ or -Z ... ',lget('switchZ')
printall,'--title or -T ..... ',sget('title')
endprogram demo9