Skip to content

FLAPFortran command Line Arguments Parser for poor people

A KISS pure Fortran 2003+ library for building powerful, elegant Command Line Interfaces — inspired by Python's argparse

Quick start

A minimal plate:

fortran
program minimal
type(command_line_interface) :: cli    ! Command Line Interface (CLI).
character(99)                :: string ! String value.
integer                      :: 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 minimal

Authors

Contributions are welcome — see the Contributing page.

Copyrights

This project is distributed under a multi-licensing system:

Anyone interested in using, developing, or contributing to this project is welcome — pick the license that best fits your needs.