flap_test_minimal.f90 Source File

A testing program for FLAP, Fortran command Line Arguments Parser for poor people


This file depends on

sourcefile~~flap_test_minimal.f90~~EfferentGraph sourcefile~flap_test_minimal.f90 flap_test_minimal.f90 sourcefile~flap.f90 flap.f90 sourcefile~flap_test_minimal.f90->sourcefile~flap.f90 sourcefile~flap_command_line_argument_t.f90 flap_command_line_argument_t.F90 sourcefile~flap.f90->sourcefile~flap_command_line_argument_t.f90 sourcefile~flap_command_line_arguments_group_t.f90 flap_command_line_arguments_group_t.f90 sourcefile~flap.f90->sourcefile~flap_command_line_arguments_group_t.f90 sourcefile~flap_command_line_interface_t.f90 flap_command_line_interface_t.F90 sourcefile~flap.f90->sourcefile~flap_command_line_interface_t.f90 sourcefile~face.f90 face.F90 sourcefile~flap_command_line_argument_t.f90->sourcefile~face.f90 sourcefile~flap_object_t.f90 flap_object_t.F90 sourcefile~flap_command_line_argument_t.f90->sourcefile~flap_object_t.f90 sourcefile~flap_utils_m.f90 flap_utils_m.f90 sourcefile~flap_command_line_argument_t.f90->sourcefile~flap_utils_m.f90 sourcefile~flap_command_line_arguments_group_t.f90->sourcefile~flap_command_line_argument_t.f90 sourcefile~flap_command_line_arguments_group_t.f90->sourcefile~face.f90 sourcefile~flap_command_line_arguments_group_t.f90->sourcefile~flap_object_t.f90 sourcefile~flap_command_line_interface_t.f90->sourcefile~flap_command_line_argument_t.f90 sourcefile~flap_command_line_interface_t.f90->sourcefile~flap_command_line_arguments_group_t.f90 sourcefile~flap_command_line_interface_t.f90->sourcefile~face.f90 sourcefile~flap_command_line_interface_t.f90->sourcefile~flap_object_t.f90 sourcefile~flap_command_line_interface_t.f90->sourcefile~flap_utils_m.f90

Source Code

!< A testing program for FLAP, Fortran command Line Arguments Parser for poor people
program flap_test_minimal
!< A testing program for FLAP, Fortran command Line Arguments Parser for poor people
!<
!<### Compile
!< See [compile instructions](https://github.com/szaghi/FLAP/wiki/Download-compile).
!<
!<###Usage Compile
!< See [usage instructions](https://github.com/szaghi/FLAP/wiki/Testing-Programs).
!<
!< @note The minimal steps for using a FLAP CLI are:
!<+ `init` the CLI;
!<+ `add` at least one CLA to the CLI;
!<+ `get` the CLAs defined into the CLI;
!<
!<Note that `get` automatically calls `parse` method beacuse it is not explicitely called.

use flap, only : command_line_interface
use penf

implicit none
type(command_line_interface) :: cli    !< Command Line Interface (CLI).
character(99)                :: string !< String value.
integer(I4P)                 :: error  !< Error trapping flag.

call cli%init(description = 'minimal FLAP example')
call cli%add(switch='--string', switch_ab='-s', help='a string', required=.true., act='store', error=error) ; if (error/=0) stop
call cli%get(switch='-s', val=string, error=error) ; if (error/=0) stop
print '(A)', cli%progname//' has been called with the following argument:'
print '(A)', 'String = '//trim(adjustl(string))
endprogram flap_test_minimal