-
Notifications
You must be signed in to change notification settings - Fork 34
CLI Method is_passed
Stefano Zaghi edited this page Mar 23, 2016
·
1 revision
Signature
is_passed = cli%is_passed(group, switch, position)
Inquire if a CLA has been actually passed to CLI. All dummy arguments are optionals.
character(*), optional, intent(in) :: group !< Name of group (command) of CLA.
character(*), optional, intent(in) :: switch !< Switch name.
integer(I4P), optional, intent(in) :: position !< Position of positional CLA.
The following rules apply:
- if no
group
is passed it assumed that the CLA belongs to the default (not named) one (group number 0); - if
switch
name is passed, the eventualposition
passed is not used;switch
is checked with bothswitch
andswitch_ab
definitions; -
position
must be passed for positional CLA.
Must be used for inquiring if a CLA has been passed to CLI
use flap
type(command_line_interface):: cli
logical:: is_passed
call cli%init(...)
call cli%add(...)
call cli%parse(...)
is_passed = cli%is_passed(group='commit', switch='-m')
if (is_passed) then
! do your job with commit message
endif
! or inquire on the fly
if (cli%is_passed(switch='--integer')) print "(A)", ' Integer value has been passed!'
Home | About | Getting Started Guide | Usage | Copyright © 2016 szaghi