Skip to content

Commit

Permalink
multi-line description
Browse files Browse the repository at this point in the history
  • Loading branch information
0382 committed Feb 11, 2023
1 parent b07f12b commit ed30bf1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/argparse-f.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module argparse
private
integer, parameter :: type_string_len = 16
integer, parameter :: short_name_len = 2
integer, parameter :: long_name_len = 16
integer, parameter :: argument_len = 16
integer, parameter :: long_name_len = 32
integer, parameter :: argument_len = 32
integer, parameter :: help_len = 1024
integer, parameter :: value_len = 1024

Expand Down Expand Up @@ -321,7 +321,12 @@ subroutine argp_print_help(this)
character(len=help_len), dimension(:), allocatable :: help_split

call this%print_usage()
print '(/,A,/,/,"Options:")', trim(this%description)
print *, ""
call split(this%description, "\n", help_split)
do i = 1, size(help_split)
print '(A)', trim(help_split(i))
end do
print '(/,A)', "Options:"

! calculate the longest option name
max_name_length = 0
Expand Down

0 comments on commit ed30bf1

Please sign in to comment.