Get signature.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
logical, | intent(in), | optional | :: | bash_completion |
Return the signature for bash completion. |
Signature.
function signature(self, bash_completion) !< Get signature. class(command_line_interface), intent(in) :: self !< CLI data. logical, optional, intent(in) :: bash_completion !< Return the signature for bash completion. logical :: bash_completion_ !< Return the signature for bash completion, local variable. character(len=:), allocatable :: signature !< Signature. integer(I4P) :: g !< Counter. bash_completion_ = .false. ; if (present(bash_completion)) bash_completion_ = bash_completion if (bash_completion_) then signature = signature//new_line('a')//' COMPREPLY=( )' signature = signature//new_line('a')//' COMPREPLY+=( $( compgen -W "'//& self%clasg(0)%signature(bash_completion=bash_completion, plain=.true.)//'" -- $cur ) )' if (size(self%clasg,dim=1)>1) then do g=1,size(self%clasg,dim=1)-1 signature = signature//new_line('a')//' COMPREPLY+=( $( compgen -W "'//self%clasg(g)%group//'" -- $cur ) )' enddo endif else signature = self%clasg(0)%signature() if (size(self%clasg,dim=1)>1) then signature = signature//' {'//self%clasg(1)%group do g=2,size(self%clasg,dim=1)-1 signature = signature//','//self%clasg(g)%group enddo signature = signature//'} ...' endif endif endfunction signature