-
Notifications
You must be signed in to change notification settings - Fork 34
CLI Method is_defined
Stefano Zaghi edited this page Mar 23, 2016
·
1 revision
Signature
is_defined = cli%is_defined(group, switch)
Inquire if a CLA has been defined into the CLI.
character(*), optional, intent(in) :: group !< Name of group (command) of CLAs.
character(*), intent(in) :: switch !< Switch name.
Note that this is a pure function.
The following rules apply:
- if no
group
is passed it assumed that the CLA belongs to the default (not named) one (group number 0); -
switch
is check with bothswitch
andswitch_ab
definitions; - presently it is not possible to inquire the definition of positional CLA.
Must be used for inquiring if a CLA has been defined into the CLI
use flap
type(command_line_interface):: cli
logical:: is_defined
call cli%init(...)
call cli%add(...)
call cli%parse(...)
is_defined = cli%is_defined(group='commit', switch='-m')
if (is_defined) then
! do your job with commit command message, e.g. check if it has been actually passed...
endif
Home | About | Getting Started Guide | Usage | Copyright © 2016 szaghi