Check if a CLA has been passed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
Check if a CLA has been passed.
function is_passed(self, group, switch, position) !< Check if a CLA has been passed. class(command_line_interface), intent(in) :: self !< CLI data. 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. logical :: is_passed !< Check if a CLA has been passed. integer(I4P) :: g !< Counter. is_passed = .false. if (.not.present(group)) then if (present(switch)) then is_passed = self%clasg(0)%is_passed(switch=switch) elseif (present(position)) then is_passed = self%clasg(0)%is_passed(position=position) endif else if (self%is_defined_group(group=group, g=g)) then if (present(switch)) then is_passed = self%clasg(g)%is_passed(switch=switch) elseif (present(position)) then is_passed = self%clasg(g)%is_passed(position=position) endif endif endif endfunction is_passed