Skip to content

Commit

Permalink
Removes allocatable limits for help_text,
Browse files Browse the repository at this point in the history
`version_text` arguments.
  • Loading branch information
zoziha committed Jun 8, 2022
1 parent 6631404 commit 147dd57
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/M_CLI2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ module M_CLI2
!!
!! subroutine check_commandline(help_text,version_text,ierr,errmsg)
!!
!! character(len=:),allocatable,intent(in),optional :: help_text(:)
!! character(len=:),allocatable,intent(in),optional :: version_text(:)
!! character(len=*),intent(in),optional :: help_text(:)
!! character(len=*),intent(in),optional :: version_text(:)
!!
!!##DESCRIPTION
!! Checks the commandline and processes the implicit --help, --version,
Expand Down Expand Up @@ -327,12 +327,12 @@ module M_CLI2
!! end program check_commandline
!===================================================================================================================================
subroutine check_commandline(help_text,version_text)
character(len=:),allocatable,intent(in),optional :: help_text(:)
character(len=:),allocatable,intent(in),optional :: version_text(:)
character(len=:),allocatable :: line
integer :: i
integer :: istart
integer :: iback
character(len=*),intent(in),optional :: help_text(:)
character(len=*),intent(in),optional :: version_text(:)
character(len=:),allocatable :: line
integer :: i
integer :: istart
integer :: iback
if(get('usage').eq.'T')then
call print_dictionary('USAGE:')
!x!call default_help()
Expand Down Expand Up @@ -362,12 +362,6 @@ subroutine check_commandline(help_text,version_text)
iback=1
endif
endif
if(debug_m_cli2)write(*,gen)'<DEBUG>CHECK_COMMANDLINE:VERSION_TEXT:ALLOCATED',allocated(version_text)
if(allocated(version_text).and.debug_m_cli2)then
write(*,gen)'<DEBUG>CHECK_COMMANDLINE:VERSION_TEXT:LEN',len(version_text)
write(*,gen)'<DEBUG>CHECK_COMMANDLINE:VERSION_TEXT:SIZE',size(version_text)
write(*,gen)'<DEBUG>CHECK_COMMANDLINE:VERSION_TEXT:LEN',version_text
endif
do i=1,size(version_text)
!xINTEL BUG*!call journal('sc',version_text(i)(istart:len_trim(version_text(i))-iback))
line=version_text(i)(istart:len_trim(version_text(i))-iback)
Expand Down Expand Up @@ -855,8 +849,8 @@ subroutine set_args(prototype,help_text,version_text,string,ierr,errmsg)
! ident_2="@(#)M_CLI2::set_args(3f): parse prototype string"

character(len=*),intent(in) :: prototype
character(len=:),intent(in),allocatable,optional :: help_text(:)
character(len=:),intent(in),allocatable,optional :: version_text(:)
character(len=*),intent(in),optional :: help_text(:)
character(len=*),intent(in),optional :: version_text(:)
character(len=*),intent(in),optional :: string
integer,intent(out),optional :: ierr
character(len=:),intent(out),allocatable,optional :: errmsg
Expand Down

1 comment on commit 147dd57

@urbanjost
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion. If you could change the comments for set_args to reflect the change too and make a pull request I will merge it (hopefully, I have it set up to allow pull requests; it you have problems let me know); Or i can make the same changes in my copy.

Please sign in to comment.