demo18 – M_CLI2
Author: John S. Urban
Description: command line parsing

# demo18 Program

- 15 statements
- Source File

### Uses

- - M_CLI2

@(#) using the convenience functions USE THE VALUES IN YOUR PROGRAM.

### Contents

### Variables

a b o o_up ox t x x_up xo

### Source Code

demo18

## Variables

Type | Attributes |  | Name |  | Initial |
--- | --- | --- | --- | --- | --- | ---
logical |  | :: | a |  |  |
logical |  | :: | b |  |  |
logical |  | :: | o |  |  |
logical |  | :: | o_up |  |  |
logical |  | :: | ox |  |  |
logical |  | :: | t |  |  |
logical |  | :: | x |  |  |
logical |  | :: | x_up |  |  |
logical |  | :: | xo |  |  |

## Source Code

    program demo18
    !!  @(#) using the convenience functions
    use M_CLI2, only : set_args, set_mode, get_args
    implicit none
    logical :: o,x,t,ox,xo,x_up,o_up,a,b

       print *,'demo18: using the bundling option'

       call set_mode('strict')
       call set_mode('ignorecase')

       call set_args('-x F -o F -X F -O F -t F --ox F -xo F -longa:a F -longb:b')
       call get_args('x',x,'o',o,'t',t,'xo',xo,'ox',ox,'X',x_up,'O',o_up)
       call get_args('longa',a,'longb',b)
    !! USE THE VALUES IN YOUR PROGRAM.
       write(*, '(*(g0:,1x))')'x=',x, 'o=',o, 't=',t
       write(*, '(*(g0:,1x))')'ox=',ox, 'xo=',xo
       write(*, '(*(g0:,1x))')'O=',o_up, 'X=',x_up
       write(*, '(*(g0:,1x))')'longa=',a, 'longb=',b

    end program demo18