File: demo9.f90

package info (click to toggle)
fortran-cli2 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 25,856 kB
  • sloc: f90: 6,172; javascript: 3,423; makefile: 188; sh: 25
file content (29 lines) | stat: -rwxr-xr-x 1,003 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
implicit none
character(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"')
   print all,'--length or -l .... ',rget('length')
   print all,'--height or -h .... ',rget('height')
   print all,'--switchX or -X ... ',lget('switchX')
   print all,'--switchY or -Y ... ',lget('switchY')
   print all,'--switchZ or -Z ... ',lget('switchZ')
   print all,'--title or -T ..... ',sget('title')
end program demo9