cli_is_set Function

private pure function cli_is_set(this, name) result(r)

Whether name appeared on the command line.

False for an undeclared name, and false for a declared one that fell back to its default.

Type Bound

cli_t

Arguments

Type IntentOptional Attributes Name
class(cli_t), intent(in) :: this
character(len=*), intent(in) :: name

Long name to look for.

Return Value logical


Calls

proc~~cli_is_set~~CallsGraph proc~cli_is_set cli_t%cli_is_set proc~cli_find cli_t%cli_find proc~cli_is_set->proc~cli_find

Variables

Type Visibility Attributes Name Initial
integer(kind=default_int), private :: idx

Source Code

   pure function cli_is_set(this, name) result(r)
      !! Whether `name` appeared on the command line.
      !!
      !! False for an undeclared name, and false for a declared one that fell
      !! back to its default.
      class(cli_t), intent(in) :: this
      character(len=*), intent(in) :: name
         !! Long name to look for.
      logical :: r

      integer(default_int) :: idx

      idx = this%find(name)
      r = idx > 0_default_int
      if (r) r = this%entries(idx)%seen > 0_default_int
   end function cli_is_set