is_short Function

private pure function is_short(arg) result(r)

Whether arg is a -s form. A bare - is not, and neither is a negative number, which must be able to reach a positional.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: arg

Return Value logical


Called by

proc~~is_short~~CalledByGraph proc~is_short is_short proc~cli_parse_args cli_t%cli_parse_args proc~cli_parse_args->proc~is_short proc~cli_parse cli_t%cli_parse proc~cli_parse->proc~cli_parse_args

Source Code

   pure function is_short(arg) result(r)
      !! Whether `arg` is a `-s` form. A bare `-` is not, and neither is a
      !! negative number, which must be able to reach a positional.
      character(len=*), intent(in) :: arg
      logical :: r

      r = .false.
      if (len(arg) /= 2) return
      if (arg(1:1) /= "-") return
      r = .not. (arg(2:2) >= "0" .and. arg(2:2) <= "9")
   end function is_short