flap_test_basic Program

Uses

  • program~~flap_test_basic~~UsesGraph program~flap_test_basic flap_test_basic module~flap flap program~flap_test_basic->module~flap penf penf program~flap_test_basic->penf module~flap_command_line_argument_t flap_command_line_argument_t module~flap->module~flap_command_line_argument_t module~flap_command_line_arguments_group_t flap_command_line_arguments_group_t module~flap->module~flap_command_line_arguments_group_t module~flap_command_line_interface_t flap_command_line_interface_t module~flap->module~flap_command_line_interface_t module~flap_command_line_argument_t->penf module~face face module~flap_command_line_argument_t->module~face module~flap_object_t flap_object_t module~flap_command_line_argument_t->module~flap_object_t module~flap_utils_m flap_utils_m module~flap_command_line_argument_t->module~flap_utils_m module~flap_command_line_arguments_group_t->penf module~flap_command_line_arguments_group_t->module~flap_command_line_argument_t module~flap_command_line_arguments_group_t->module~face module~flap_command_line_arguments_group_t->module~flap_object_t module~flap_command_line_interface_t->penf module~flap_command_line_interface_t->module~flap_command_line_argument_t module~flap_command_line_interface_t->module~flap_command_line_arguments_group_t module~flap_command_line_interface_t->module~face module~flap_command_line_interface_t->module~flap_object_t module~flap_command_line_interface_t->module~flap_utils_m iso_fortran_env iso_fortran_env module~face->iso_fortran_env module~flap_object_t->penf module~flap_object_t->iso_fortran_env module~flap_utils_m->penf

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

Compile

See compile instructions.

Usage Compile

See usage instructions.


Calls

program~~flap_test_basic~~CallsGraph program~flap_test_basic flap_test_basic none~get_varying~2 flap_command_line_interface_t::command_line_interface%get_varying program~flap_test_basic->none~get_varying~2 none~get~2 flap_command_line_interface_t::command_line_interface%get program~flap_test_basic->none~get~2 proc~add~2 flap_command_line_interface_t::command_line_interface%add program~flap_test_basic->proc~add~2 proc~init flap_command_line_interface_t::command_line_interface%init program~flap_test_basic->proc~init proc~is_passed~2 flap_command_line_interface_t::command_line_interface%is_passed program~flap_test_basic->proc~is_passed~2 proc~parse~2 flap_command_line_interface_t::command_line_interface%parse program~flap_test_basic->proc~parse~2 proc~save_man_page flap_command_line_interface_t::command_line_interface%save_man_page program~flap_test_basic->proc~save_man_page str str program~flap_test_basic->str proc~get_cla_list_varying_char~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_char none~get_varying~2->proc~get_cla_list_varying_char~2 proc~get_cla_list_varying_i1p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I1P none~get_varying~2->proc~get_cla_list_varying_i1p~2 proc~get_cla_list_varying_i2p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I2P none~get_varying~2->proc~get_cla_list_varying_i2p~2 proc~get_cla_list_varying_i4p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I4P none~get_varying~2->proc~get_cla_list_varying_i4p~2 proc~get_cla_list_varying_i8p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_I8P none~get_varying~2->proc~get_cla_list_varying_i8p~2 proc~get_cla_list_varying_logical~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_logical none~get_varying~2->proc~get_cla_list_varying_logical~2 proc~get_cla_list_varying_r4p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_R4P none~get_varying~2->proc~get_cla_list_varying_r4p~2 proc~get_cla_list_varying_r8p~2 flap_command_line_interface_t::command_line_interface%get_cla_list_varying_R8P none~get_varying~2->proc~get_cla_list_varying_r8p~2 proc~get_cla_list~2 flap_command_line_interface_t::command_line_interface%get_cla_list none~get~2->proc~get_cla_list~2 proc~get_cla~2 flap_command_line_interface_t::command_line_interface%get_cla none~get~2->proc~get_cla~2 proc~add flap_command_line_arguments_group_t::command_line_arguments_group%add proc~add~2->proc~add proc~add_group flap_command_line_interface_t::command_line_interface%add_group proc~add~2->proc~add_group proc~assign_object flap_object_t::object%assign_object proc~add~2->proc~assign_object proc~check~2 flap_command_line_argument_t::command_line_argument%check proc~add~2->proc~check~2 proc~is_defined_group flap_command_line_interface_t::command_line_interface%is_defined_group proc~add~2->proc~is_defined_group proc~upper_case flap_utils_m::upper_case proc~add~2->proc~upper_case proc~init->proc~assign_object proc~set_examples flap_object_t::object%set_examples proc~init->proc~set_examples proc~is_passed~2->proc~is_defined_group proc~is_passed flap_command_line_arguments_group_t::command_line_arguments_group%is_passed proc~is_passed~2->proc~is_passed proc~parse~2->proc~add~2 none~get_args flap_command_line_interface_t::command_line_interface%get_args proc~parse~2->none~get_args proc~check_m_exclusive~2 flap_command_line_interface_t::command_line_interface%check_m_exclusive proc~parse~2->proc~check_m_exclusive~2 proc~check~3 flap_command_line_interface_t::command_line_interface%check proc~parse~2->proc~check~3 proc~is_defined~2 flap_command_line_interface_t::command_line_interface%is_defined proc~parse~2->proc~is_defined~2 proc~is_required_passed flap_command_line_arguments_group_t::command_line_arguments_group%is_required_passed proc~parse~2->proc~is_required_passed proc~parse flap_command_line_arguments_group_t::command_line_arguments_group%parse proc~parse~2->proc~parse proc~print_version flap_object_t::object%print_version proc~parse~2->proc~print_version proc~sanitize_defaults flap_command_line_arguments_group_t::command_line_arguments_group%sanitize_defaults proc~parse~2->proc~sanitize_defaults proc~save_usage_to_markdown flap_command_line_interface_t::command_line_interface%save_usage_to_markdown proc~parse~2->proc~save_usage_to_markdown proc~usage~3 flap_command_line_interface_t::command_line_interface%usage proc~parse~2->proc~usage~3 proc~signature~3 flap_command_line_interface_t::command_line_interface%signature proc~save_man_page->proc~signature~3 proc~save_man_page->proc~usage~3 strz strz proc~save_man_page->strz proc~get_args_from_invocation flap_command_line_interface_t::command_line_interface%get_args_from_invocation none~get_args->proc~get_args_from_invocation proc~get_args_from_string flap_command_line_interface_t::command_line_interface%get_args_from_string none~get_args->proc~get_args_from_string proc~check flap_command_line_arguments_group_t::command_line_arguments_group%check proc~add->proc~check proc~add_group->proc~assign_object proc~add_group->proc~is_defined_group proc~add_group->proc~set_examples proc~check_m_exclusive~2->proc~is_defined_group proc~raise_error_m_exclude flap_command_line_arguments_group_t::command_line_arguments_group%raise_error_m_exclude proc~check_m_exclusive~2->proc~raise_error_m_exclude proc~check_action_consistency flap_command_line_argument_t::command_line_argument%check_action_consistency proc~check~2->proc~check_action_consistency proc~check_envvar_consistency flap_command_line_argument_t::command_line_argument%check_envvar_consistency proc~check~2->proc~check_envvar_consistency proc~check_m_exclude_consistency flap_command_line_argument_t::command_line_argument%check_m_exclude_consistency proc~check~2->proc~check_m_exclude_consistency proc~check_named_consistency flap_command_line_argument_t::command_line_argument%check_named_consistency proc~check~2->proc~check_named_consistency proc~check_optional_consistency flap_command_line_argument_t::command_line_argument%check_optional_consistency proc~check~2->proc~check_optional_consistency proc~check_positional_consistency flap_command_line_argument_t::command_line_argument%check_positional_consistency proc~check~2->proc~check_positional_consistency proc~check~3->proc~is_defined_group proc~check~3->proc~check proc~get_cla_list_varying_char~2->proc~parse~2 proc~get_cla_list_varying_char~2->proc~is_defined_group none~get_varying flap_command_line_argument_t::command_line_argument%get_varying proc~get_cla_list_varying_char~2->none~get_varying proc~errored~3 flap_command_line_interface_t::command_line_interface%errored proc~get_cla_list_varying_char~2->proc~errored~3 proc~get_cla_list_varying_i1p~2->proc~parse~2 proc~get_cla_list_varying_i1p~2->proc~is_defined_group proc~get_cla_list_varying_i1p~2->none~get_varying proc~get_cla_list_varying_i1p~2->proc~errored~3 proc~get_cla_list_varying_i2p~2->proc~parse~2 proc~get_cla_list_varying_i2p~2->proc~is_defined_group proc~get_cla_list_varying_i2p~2->none~get_varying proc~get_cla_list_varying_i2p~2->proc~errored~3 proc~get_cla_list_varying_i4p~2->proc~parse~2 proc~get_cla_list_varying_i4p~2->proc~is_defined_group proc~get_cla_list_varying_i4p~2->none~get_varying proc~get_cla_list_varying_i4p~2->proc~errored~3 proc~get_cla_list_varying_i8p~2->proc~parse~2 proc~get_cla_list_varying_i8p~2->proc~is_defined_group proc~get_cla_list_varying_i8p~2->none~get_varying proc~get_cla_list_varying_i8p~2->proc~errored~3 proc~get_cla_list_varying_logical~2->proc~parse~2 proc~get_cla_list_varying_logical~2->proc~is_defined_group proc~get_cla_list_varying_logical~2->none~get_varying proc~get_cla_list_varying_logical~2->proc~errored~3 proc~get_cla_list_varying_r4p~2->proc~parse~2 proc~get_cla_list_varying_r4p~2->proc~is_defined_group proc~get_cla_list_varying_r4p~2->none~get_varying proc~get_cla_list_varying_r4p~2->proc~errored~3 proc~get_cla_list_varying_r8p~2->proc~parse~2 proc~get_cla_list_varying_r8p~2->proc~is_defined_group proc~get_cla_list_varying_r8p~2->none~get_varying proc~get_cla_list_varying_r8p~2->proc~errored~3 proc~get_cla_list~2->proc~parse~2 proc~get_cla_list~2->proc~is_defined_group none~get flap_command_line_argument_t::command_line_argument%get proc~get_cla_list~2->none~get proc~get_cla_list~2->proc~errored~3 proc~get_cla~2->proc~parse~2 proc~get_cla~2->proc~is_defined_group proc~get_cla~2->none~get proc~get_cla~2->proc~errored~3 proc~is_defined~2->proc~is_defined_group proc~is_defined flap_command_line_arguments_group_t::command_line_arguments_group%is_defined proc~is_defined~2->proc~is_defined proc~is_required_passed~2 flap_command_line_argument_t::command_line_argument%is_required_passed proc~is_required_passed->proc~is_required_passed~2 proc~usage flap_command_line_arguments_group_t::command_line_arguments_group%usage proc~is_required_passed->proc~usage proc~parse->proc~add proc~parse->proc~assign_object proc~parse->proc~sanitize_defaults cton cton proc~parse->cton proc~check_m_exclusive flap_command_line_arguments_group_t::command_line_arguments_group%check_m_exclusive proc~parse->proc~check_m_exclusive proc~parse->proc~is_defined proc~raise_error_duplicated_clas flap_command_line_argument_t::command_line_argument%raise_error_duplicated_clas proc~parse->proc~raise_error_duplicated_clas proc~raise_error_nargs_insufficient flap_command_line_argument_t::command_line_argument%raise_error_nargs_insufficient proc~parse->proc~raise_error_nargs_insufficient proc~raise_error_switch_unknown flap_command_line_argument_t::command_line_argument%raise_error_switch_unknown proc~parse->proc~raise_error_switch_unknown proc~raise_error_value_missing flap_command_line_argument_t::command_line_argument%raise_error_value_missing proc~parse->proc~raise_error_value_missing proc~sanitize_defaults~2 flap_command_line_argument_t::command_line_argument%sanitize_defaults proc~sanitize_defaults->proc~sanitize_defaults~2 proc~save_usage_to_markdown->proc~signature~3 proc~save_usage_to_markdown->proc~usage~3 proc~save_usage_to_markdown->strz proc~signature flap_command_line_arguments_group_t::command_line_arguments_group%signature proc~signature~3->proc~signature proc~usage~3->proc~signature~3 proc~usage~3->proc~usage proc~get_cla flap_command_line_argument_t::command_line_argument%get_cla none~get->proc~get_cla proc~get_cla_list flap_command_line_argument_t::command_line_argument%get_cla_list none~get->proc~get_cla_list proc~get_cla_list_varying_char flap_command_line_argument_t::command_line_argument%get_cla_list_varying_char none~get_varying->proc~get_cla_list_varying_char proc~get_cla_list_varying_i1p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_I1P none~get_varying->proc~get_cla_list_varying_i1p proc~get_cla_list_varying_i2p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_I2P none~get_varying->proc~get_cla_list_varying_i2p proc~get_cla_list_varying_i4p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_I4P none~get_varying->proc~get_cla_list_varying_i4p proc~get_cla_list_varying_i8p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_I8P none~get_varying->proc~get_cla_list_varying_i8p proc~get_cla_list_varying_logical flap_command_line_argument_t::command_line_argument%get_cla_list_varying_logical none~get_varying->proc~get_cla_list_varying_logical proc~get_cla_list_varying_r4p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_R4P none~get_varying->proc~get_cla_list_varying_r4p proc~get_cla_list_varying_r8p flap_command_line_argument_t::command_line_argument%get_cla_list_varying_R8P none~get_varying->proc~get_cla_list_varying_r8p proc~check->proc~is_defined proc~errored flap_command_line_arguments_group_t::command_line_arguments_group%errored proc~check->proc~errored proc~errored~2 flap_command_line_argument_t::command_line_argument%errored proc~check_action_consistency->proc~errored~2 proc~check_envvar_consistency->proc~errored~2 proc~check_m_exclude_consistency->proc~errored~2 proc~check_m_exclusive->proc~is_passed proc~raise_error_m_exclude~2 flap_command_line_argument_t::command_line_argument%raise_error_m_exclude proc~check_m_exclusive->proc~raise_error_m_exclude~2 proc~check_named_consistency->proc~errored~2 proc~check_optional_consistency->proc~errored~2 proc~check_positional_consistency->proc~errored~2 interface~colorize face::colorize proc~errored~3->interface~colorize proc~print_error_message flap_object_t::object%print_error_message proc~errored~3->proc~print_error_message proc~get_clasg_indexes flap_command_line_interface_t::command_line_interface%get_clasg_indexes proc~get_args_from_invocation->proc~get_clasg_indexes proc~get_args_from_string->proc~get_clasg_indexes proc~tokenize flap_utils_m::tokenize proc~get_args_from_string->proc~tokenize proc~is_required_passed~2->proc~errored~2 proc~raise_error_duplicated_clas->proc~errored~2 proc~raise_error_m_exclude->proc~errored proc~raise_error_nargs_insufficient->proc~errored~2 proc~raise_error_switch_unknown->proc~errored~2 proc~raise_error_value_missing->proc~errored~2 proc~replace_all flap_utils_m::replace_all proc~sanitize_defaults~2->proc~replace_all proc~unique flap_utils_m::unique proc~sanitize_defaults~2->proc~unique proc~wstrip flap_utils_m::wstrip proc~sanitize_defaults~2->proc~wstrip proc~signature~2 flap_command_line_argument_t::command_line_argument%signature proc~signature->proc~signature~2 proc~usage->proc~signature proc~usage~2 flap_command_line_argument_t::command_line_argument%usage proc~usage->proc~usage~2 proc~colorize_default face::colorize_default interface~colorize->proc~colorize_default proc~errored->str proc~errored->interface~colorize proc~errored->proc~print_error_message proc~errored~2->str proc~errored~2->interface~colorize proc~errored~2->proc~print_error_message proc~get_cla->proc~is_required_passed~2 proc~get_cla->proc~errored~2 proc~check_choices flap_command_line_argument_t::command_line_argument%check_choices proc~get_cla->proc~check_choices proc~get_cla_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_from_buffer proc~get_cla->proc~get_cla_from_buffer proc~get_cla_list->proc~is_required_passed~2 proc~get_cla_list->proc~errored~2 proc~get_cla_list->proc~tokenize proc~get_cla_list_from_buffer flap_command_line_argument_t::command_line_argument%get_cla_list_from_buffer proc~get_cla_list->proc~get_cla_list_from_buffer proc~get_cla_list_varying_char->proc~is_required_passed~2 proc~get_cla_list_varying_char->proc~errored~2 proc~get_cla_list_varying_char->proc~tokenize proc~check_list_size flap_command_line_argument_t::command_line_argument%check_list_size proc~get_cla_list_varying_char->proc~check_list_size proc~get_cla_list_varying_i1p->cton proc~get_cla_list_varying_i1p->proc~is_required_passed~2 proc~get_cla_list_varying_i1p->proc~errored~2 proc~get_cla_list_varying_i1p->proc~tokenize proc~get_cla_list_varying_i1p->proc~check_list_size proc~get_cla_list_varying_i2p->cton proc~get_cla_list_varying_i2p->proc~is_required_passed~2 proc~get_cla_list_varying_i2p->proc~errored~2 proc~get_cla_list_varying_i2p->proc~tokenize proc~get_cla_list_varying_i2p->proc~check_list_size proc~get_cla_list_varying_i4p->cton proc~get_cla_list_varying_i4p->proc~is_required_passed~2 proc~get_cla_list_varying_i4p->proc~errored~2 proc~get_cla_list_varying_i4p->proc~tokenize proc~get_cla_list_varying_i4p->proc~check_list_size proc~get_cla_list_varying_i8p->cton proc~get_cla_list_varying_i8p->proc~is_required_passed~2 proc~get_cla_list_varying_i8p->proc~errored~2 proc~get_cla_list_varying_i8p->proc~tokenize proc~get_cla_list_varying_i8p->proc~check_list_size proc~get_cla_list_varying_logical->proc~is_required_passed~2 proc~get_cla_list_varying_logical->proc~errored~2 proc~get_cla_list_varying_logical->proc~tokenize proc~get_cla_list_varying_logical->proc~check_list_size proc~get_cla_list_varying_r4p->cton proc~get_cla_list_varying_r4p->proc~is_required_passed~2 proc~get_cla_list_varying_r4p->proc~errored~2 proc~get_cla_list_varying_r4p->proc~tokenize proc~get_cla_list_varying_r4p->proc~check_list_size proc~get_cla_list_varying_r8p->cton proc~get_cla_list_varying_r8p->proc~is_required_passed~2 proc~get_cla_list_varying_r8p->proc~errored~2 proc~get_cla_list_varying_r8p->proc~tokenize proc~get_cla_list_varying_r8p->proc~check_list_size proc~get_clasg_indexes->proc~is_defined_group proc~raise_error_m_exclude~2->proc~errored~2 proc~replace_all->proc~wstrip proc~replace flap_utils_m::replace proc~replace_all->proc~replace proc~signature~2->str proc~signature~2->cton proc~has_choices flap_command_line_argument_t::command_line_argument%has_choices proc~signature~2->proc~has_choices proc~usage~2->str proc~usage~2->cton proc~usage~2->interface~colorize proc~usage~2->proc~replace_all proc~check_choices->str proc~check_choices->cton proc~check_choices->proc~errored~2 proc~check_choices->proc~tokenize proc~check_list_size->proc~errored~2 proc~color_index face::color_index proc~colorize_default->proc~color_index proc~style_index face::style_index proc~colorize_default->proc~style_index proc~upper face::upper proc~colorize_default->proc~upper proc~get_cla_from_buffer->cton proc~get_cla_from_buffer->proc~errored~2 proc~get_cla_list_from_buffer->cton proc~get_cla_list_from_buffer->proc~errored~2 proc~get_cla_list_from_buffer->proc~tokenize proc~get_cla_list_from_buffer->proc~check_choices

Variables

Type Attributes Name Initial
type(command_line_interface) :: cli

Command Line Interface (CLI).

character(len=99) :: sval

String value.

real(kind=R8P) :: rval

Real value.

real(kind=R8P) :: prval

Positional real value.

integer(kind=I4P) :: ival

Integer value.

integer(kind=I4P) :: ieval

Exclusive integer value.

integer(kind=I4P) :: envi

Environment set integer value.

logical :: bval

Boolean value.

logical :: vbval

Valued-boolean value.

integer(kind=I8P) :: ilist(1:3)

Integer list values.

real(kind=R8P), allocatable :: vlistR8P(:)

Varying size real list values.

real(kind=R4P), allocatable :: vlistR4P(:)

Varying size real list values.

integer(kind=I8P), allocatable :: vlistI8P(:)

Varying size integer list values.

integer(kind=I4P), allocatable :: vlistI4P(:)

Varying size integer list values.

integer(kind=I2P), allocatable :: vlistI2P(:)

Varying size integer list values.

integer(kind=I1P), allocatable :: vlistI1P(:)

Varying size integer list values.

logical, allocatable :: vlistBool(:)

Varying size boolean list values.

character(len=10), allocatable :: vlistChar(:)

Varying size character list values.

character(len=99), allocatable :: garbage(:)

Varying size character list for trailing garbage values.

integer(kind=I4P) :: error

Error trapping flag.

integer(kind=I4P) :: l

Counter.


Source Code

program flap_test_basic
!< 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).

use flap, only : command_line_interface
use penf

implicit none
type(command_line_interface) :: cli          !< Command Line Interface (CLI).
character(99)                :: sval         !< String value.
real(R8P)                    :: rval         !< Real value.
real(R8P)                    :: prval        !< Positional real value.
integer(I4P)                 :: ival         !< Integer value.
integer(I4P)                 :: ieval        !< Exclusive integer value.
integer(I4P)                 :: envi         !< Environment set integer value.
logical                      :: bval         !< Boolean value.
logical                      :: vbval        !< Valued-boolean value.
integer(I8P)                 :: ilist(1:3)   !< Integer list values.
real(R8P),     allocatable   :: vlistR8P(:)  !< Varying size real list values.
real(R4P),     allocatable   :: vlistR4P(:)  !< Varying size real list values.
integer(I8P),  allocatable   :: vlistI8P(:)  !< Varying size integer list values.
integer(I4P),  allocatable   :: vlistI4P(:)  !< Varying size integer list values.
integer(I2P),  allocatable   :: vlistI2P(:)  !< Varying size integer list values.
integer(I1P),  allocatable   :: vlistI1P(:)  !< Varying size integer list values.
logical,       allocatable   :: vlistBool(:) !< Varying size boolean list values.
character(10), allocatable   :: vlistChar(:) !< Varying size character list values.
character(99), allocatable   :: garbage(:)   !< Varying size character list for trailing garbage values.
integer(I4P)                 :: error        !< Error trapping flag.
integer(I4P)                 :: l            !< Counter.

! initialize Command Line Interface
call cli%init(progname    = 'test_basic',                                                 &
              version     = 'v2.1.5',                                                     &
              authors     = 'Stefano Zaghi',                                              &
              license     = 'MIT',                                                        &
              help        = 'Usage: ',                                                    &
              description = 'Toy program for testing FLAP',                               &
              examples    = ["test_basic -s 'Hello FLAP'                               ", &
                             "test_basic -s 'Hello FLAP' -i -2 # printing error...     ", &
                             "test_basic -s 'Hello FLAP' -i 3 -ie 1 # printing error...", &
                             "test_basic -s 'Hello FLAP' -i 3 -r 33.d0                 ", &
                             "test_basic -s 'Hello FLAP' --integer_list 10 -3 87       ", &
                             "test_basic -s 'Hello FLAP' --man_file FLAP.1             ", &
                             "test_basic 33.0 -s 'Hello FLAP' -i 5                     ", &
                             "test_basic --string 'Hello FLAP' --boolean               "],&
              epilog      = new_line('a')//"And that's how to FLAP your life")

! set Command Line Argumenst
call cli%add(switch='--string',switch_ab='-s',help='String input',required=.true.,act='store',error=error)
if (error/=0) stop
call cli%add(switch='--integer_ex',switch_ab='-ie',help='Exclusive integer input',required=.false.,act='store',def='-1',error=error)
if (error/=0) stop
call cli%add(switch='--integer',switch_ab='-i',help='Integer input with fixed range',required=.false.,act='store',&
             def='1',choices='1,3,5',exclude='-ie',error=error)
if (error/=0) stop
call cli%add(switch='--real',switch_ab='-r',help='Real input',required=.false.,act='store',def='1.0',error=error)
if (error/=0) stop
call cli%add(switch='--boolean',switch_ab='-b',help='Boolean input',required=.false.,act='store_true',def='.false.',&
             error=error)
if (error/=0) stop
call cli%add(switch='--boolean_val',switch_ab='-bv',help='Valued boolean input',required=.false., act='store',&
             def='.true.',error=error)
if (error/=0) stop
call cli%add(switch='--integer_list',switch_ab='-il',help='Integer list input',required=.false.,act='store',&
             nargs='3',def='1 8 32',error=error)
if (error/=0) stop
call cli%add(positional=.true.,position=1,help='Positional real input',required=.false.,def='1.0',error=error)
if (error/=0) stop
call cli%add(switch='--env',switch_ab='-e',help='Environment input',required=.false.,act='store',def='-1',envvar='FLAP_NUM_INT',&
             error=error)
if (error/=0) stop
call cli%add(switch='--man_file',help='Save manual into man_file',required=.false.,act='store',def='test_basic.1',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listR8P',switch_ab='-vlR8P',help='Varying size real R8P list input',required=.false.,act='store',&
             nargs='*',def='1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listR4P',switch_ab='-vlR4P',help='Varying size real R4P list input',required=.false.,act='store',&
             nargs='*',def='1.0 2.0 3.0 4.0',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listI8P',switch_ab='-vlI8P',help='Varying size integer I8P list input',required=.false.,act='store',&
             nargs='*',def='1 2 3 4 5 6 7 8',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listI4P',switch_ab='-vlI4P',help='Varying size integer I4P list input',required=.false.,act='store',&
             nargs='*',def='1 2 3 4',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listI2P',switch_ab='-vlI2P',help='Varying size integer I2P list input',required=.false.,act='store',&
             nargs='*',def='1 2',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listI1P',switch_ab='-vlI1P',help='Varying size integer I1P list input',required=.false.,act='store',&
             nargs='+',def='1',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listBool',switch_ab='-vlBool',help='Varying size boolean list input',required=.false.,act='store',&
             nargs='*',def='T F T T F',error=error)
if (error/=0) stop
call cli%add(switch='--varying_listChar',switch_ab='-vlChar',help='Varying size character list input',required=.false.,act='store',&
             nargs='*',def='foo bar baz',error=error)
if (error/=0) stop

! parse Command Line Interface
! this is optional: if skipped the first call to cli%get will automatically call cli%parse
call cli%parse(error=error)
if (error/=0) stop

! use Command Line Interface data to set test_basic behaviour
call cli%get(        switch='-s',      val=sval,      error=error) ; if (error/=0) stop
call cli%get(        switch='-r',      val=rval,      error=error) ; if (error/=0) stop
call cli%get(        switch='-i',      val=ival,      error=error) ; if (error/=0) stop
call cli%get(        switch='-ie',     val=ieval,     error=error) ; if (error/=0) stop
call cli%get(        switch='-b',      val=bval,      error=error) ; if (error/=0) stop
call cli%get(        switch='-bv',     val=vbval,     error=error) ; if (error/=0) stop
call cli%get(        switch='-il',     val=ilist,     error=error) ; if (error/=0) stop
call cli%get(        switch='-e',      val=envi,      error=error) ; if (error/=0) stop
call cli%get(        position=1_I4P,   val=prval,     error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlR8P',  val=vlistR8P,  error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlR4P',  val=vlistR4P,  error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlI8P',  val=vlistI8P,  error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlI4P',  val=vlistI4P,  error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlI2P',  val=vlistI2P,  error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlI1P',  val=vlistI1P,  error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlBool', val=vlistBool, error=error) ; if (error/=0) stop
call cli%get_varying(switch='-vlChar', val=vlistChar, error=error) ; if (error/=0) stop
call cli%get_varying(switch='--',      val=garbage,   error=error) ; if (error/=0) stop
print '(A)'   ,'test_basic has been called with the following arguments values:'
print '(A)'   ,'String              input = '//trim(adjustl(sval))
print '(A)'   ,'Real                input = '//str(n=rval)
print '(A)'   ,'Integer             input = '//str(n=ival)
print '(A)'   ,'Exclusive   integer input = '//str(n=ieval)
print '(A)'   ,'Environment integer input = '//str(n=envi)
print '(A,L1)','Boolean             input = ',bval
print '(A,L1)','Valued boolean      input = ',vbval
print '(A)'   ,'Positional real     input = '//str(n=prval)
print '(A)'   ,'Integer list inputs:'
do l=1, 3
  print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=ilist(l)))
enddo
if (allocated(vlistR8P)) then
  print '(A)'   ,'Varying size real R8P list inputs:'
  do l=1, size(vlistR8P)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=vlistR8P(l)))
  enddo
else
  print '(A)'   ,'Problems occuour with varying size real R8P list!'
endif
if (allocated(vlistR4P)) then
  print '(A)'   ,'Varying size real R4P list inputs:'
  do l=1, size(vlistR4P)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=vlistR4P(l)))
  enddo
else
  print '(A)'   ,'Problems occuour with varying size real R4P list!'
endif
if (allocated(vlistI8P)) then
  print '(A)'   ,'Varying size integer I8P list inputs:'
  do l=1, size(vlistI8P)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=vlistI8P(l)))
  enddo
else
  print '(A)'   ,'Problems occuour with varying size integer I8P list!'
endif
if (allocated(vlistI4P)) then
  print '(A)'   ,'Varying size integer I4P list inputs:'
  do l=1, size(vlistI4P)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=vlistI4P(l)))
  enddo
else
  print '(A)'   ,'Problems occuour with varying size integer I4P list!'
endif
if (allocated(vlistI2P)) then
  print '(A)'   ,'Varying size integer I2P list inputs:'
  do l=1, size(vlistI2P)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=vlistI2P(l)))
  enddo
else
  print '(A)'   ,'Problems occuour with varying size integer I2P list!'
endif
if (allocated(vlistI1P)) then
  print '(A)'   ,'Varying size integer I1P list inputs:'
  do l=1, size(vlistI1P)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//trim(str(n=vlistI1P(l)))
  enddo
else
  print '(A)'   ,'Problems occuour with varying size integer I1P list!'
endif
if (allocated(vlistBool)) then
  print '(A)'   ,'Varying size boolean list inputs:'
  do l=1, size(vlistBool)
    print '(A,L1)' ,'  Input('//trim(str(l, .true.))//') = ',vlistBool(l)
  enddo
else
  print '(A)'   ,'Problems occuour with varying size boolean list!'
endif
if (allocated(vlistChar)) then
  print '(A)'   ,'Varying size character list inputs:'
  do l=1, size(vlistChar)
    print '(A)' ,'  Input('//trim(str(l, .true.))//') = '//vlistChar(l)
  enddo
else
  print '(A)'   ,'Problems occuour with varying size character list!'
endif
if (allocated(garbage)) then
  print '(A)'   ,'You have used implicit "--" option for collecting list of "trailing garbage" values that are:'
  do l=1, size(garbage)
    print '(A)' ,'  Garbage('//trim(str(l, .true.))//') = '//garbage(l)
  enddo
endif
if (cli%is_passed(switch='--man_file')) then
  call cli%get(switch='--man_file',val=sval,error=error) ; if (error/=0) stop
  print '(A)','Saving man page'
  call cli%save_man_page(error=error,man_file=trim(adjustl(sval)))
endif
endprogram flap_test_basic