Argparse-style API
Define your CLI with a handful of method calls. FLAP automatically generates help, usage, and version messages — no boilerplate.
A KISS pure Fortran 2003+ library for building powerful, elegant Command Line Interfaces — inspired by Python's argparse
A minimal plate:
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 minimalContributions are welcome — see the Contributing page.
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.