Skip to content

CLI Method is_defined_group

Stefano Zaghi edited this page Mar 23, 2016 · 1 revision

is_defined_group

Signature

is_defined =  cli%is_defined_group(group, g)
Meaning

Inquire if a CLAs group (a command) has been defined into the CLI.

Dummy arguments
character(*),           intent(in)  :: group !< Name of group (command) of CLA.
integer(I4P), optional, intent(out) :: g     !< Index of group.

Note that this is not a pure function, it has a side effect: the optional argument g, if passed, returns the number of the group (command) named group. Such a feature is intended to be used internally rather than from the final user, because the array of groups (commands) is not publicly accessible.

Usage

Must be used for inquiring if a CLAs group (command) 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(group='commit')
if (is_defined) then
  ! do your job with commit command, e.g. check if it has been actually passed...
endif
Clone this wiki locally