File: demo_set_mode.f90

package info (click to toggle)
fortran-cli2 3.2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,856 kB
  • sloc: f90: 6,172; javascript: 3,423; makefile: 186; sh: 25
file content (29 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download | duplicates (2)
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 demo_set_mode
     use M_CLI2,  only : set_args, lget, set_mode
     implicit none
     character(len=*),parameter :: all='(*(g0))'
        !
        ! enable use of response files
        call set_mode('response_file')
        !
        ! Any dash in a keyword is treated as an underscore
        call set_mode('underdash')
        !
        ! The case of long keywords are ignored.
        ! Values and short names remain case-sensitive
        call set_mode('ignorecase')
        !
        ! short single-character boolean keys may be bundled
        ! but it is required that a single dash is used for
        ! short keys and a double dash for long keywords.
        call set_mode('strict')
        !
        call set_args(' --switch_X:X F --switch-Y:Y F --ox:O F -t F -x F -o F')
        !
        print all,'--switch_X or -X ... ',lget('switch_X')
        print all,'--switch_Y or -Y ... ',lget('switch_Y')
        print all,'--ox or -O       ... ',lget('ox')
        print all,'-o               ... ',lget('o')
        print all,'-x               ... ',lget('x')
        print all,'-t               ... ',lget('t')
     end program demo_set_mode