flap_test_save_usage_to_markdown.f90 Source File

Test save_usage_to_markdown method.


This file depends on

sourcefile~~flap_test_save_usage_to_markdown.f90~~EfferentGraph sourcefile~flap_test_save_usage_to_markdown.f90 flap_test_save_usage_to_markdown.f90 sourcefile~flap.f90 flap.f90 sourcefile~flap_test_save_usage_to_markdown.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

!< Test `save_usage_to_markdown` method.
program flap_save_usage_to_markdown
!< Test `save_usage_to_markdown` method.

use flap, only : command_line_interface
use penf

implicit none
type(command_line_interface) :: cli !< Command Line Interface (CLI).
character(99)                :: md  !< Markdown file name.
integer(I4P)                 :: i   !< Integer input.
real(R8P)                    :: r   !< Real input.

call cli%init(progname='flap_save_usage_to_markdown',                 &
              version='1.1.2',                                        &
              authors='Batman and Robin',                             &
              license='GPL v3',                                       &
              description = 'FLAP test save man page',                &
              examples=['flap_save_usage_to_markdown                       ', &
                        'flap_save_usage_to_markdown -m test.md -i 4       ', &
                        'flap_save_usage_to_markdown 3.2 -m test.md        ', &
                        'flap_save_usage_to_markdown -1.5 -m test.md -i 102'])
call cli%add(switch='--md',      switch_ab='-m', help='markdown file name', required=.false., act='store', def='test.md')
call cli%add(switch='--integer', switch_ab='-i', help='a integer',          required=.false., act='store', def='2'      )
call cli%add(positional=.true.,position=1,       help='a positional real',  required=.false.,              def='1.0'    )
call cli%get(switch='-m',    val=md)
call cli%save_usage_to_markdown(markdown_file=trim(md))
endprogram flap_save_usage_to_markdown