@@ -190,9 +190,9 @@ module fpm_command_line
190
190
subroutine get_command_line_settings (cmd_settings )
191
191
class(fpm_cmd_settings), allocatable , intent (out ) :: cmd_settings
192
192
193
+ integer , parameter :: widest = 256
193
194
character (len= 4096 ) :: cmdarg
194
195
integer :: i
195
- integer :: widest
196
196
integer :: os
197
197
logical :: unix
198
198
type (fpm_install_settings), allocatable :: install_settings
@@ -423,7 +423,6 @@ subroutine get_command_line_settings(cmd_settings)
423
423
elseif (unnamed(2 )==' manual' )then
424
424
unnamed= manual
425
425
endif
426
- widest= 256
427
426
allocate (character (len= widest) :: help_text(0 ))
428
427
do i= 2 ,size (unnamed)
429
428
select case (unnamed(i))
@@ -494,10 +493,12 @@ subroutine get_command_line_settings(cmd_settings)
494
493
call set_args(common_args // ' &
495
494
& --list F&
496
495
&' , help_list, version_text)
497
- call printhelp(help_list_nodash)
498
496
if (lget(' list' ))then
499
- call printhelp(help_list_dash)
497
+ help_text = [character (widest) :: help_list_nodash, help_list_dash]
498
+ else
499
+ help_text = help_list_nodash
500
500
endif
501
+ call printhelp(help_text)
501
502
502
503
case (' test' )
503
504
call set_args(common_args // compiler_args // run_args // ' --' , &
@@ -576,23 +577,23 @@ subroutine get_command_line_settings(cmd_settings)
576
577
577
578
if (cmdarg.ne. ' ' .and. which(' fpm-' // cmdarg).ne. ' ' )then
578
579
call run(' fpm-' // trim (cmdarg)// ' ' // get_command_arguments_quoted(),.false. )
580
+ stop
579
581
else
580
582
call set_args(' &
581
583
& --list F&
582
584
&' , help_fpm, version_text)
583
585
! Note: will not get here if --version or --usage or --help
584
586
! is present on commandline
585
- help_text= help_usage
586
587
if (lget(' list' ))then
587
- help_text= help_list_dash
588
+ help_text = help_list_dash
588
589
elseif (len_trim (cmdarg)==0 )then
589
590
write (stdout,' (*(a))' )' Fortran Package Manager:'
590
591
write (stdout,' (*(a))' )' '
591
- call printhelp(help_list_nodash)
592
+ help_text = [ character (widest) :: help_list_nodash, help_usage]
592
593
else
593
594
write (stderr,' (*(a))' )' <ERROR> unknown subcommand [' , &
594
595
& trim (cmdarg), ' ]'
595
- call printhelp(help_list_dash)
596
+ help_text = [ character (widest) :: help_list_dash, help_usage]
596
597
endif
597
598
call printhelp(help_text)
598
599
endif
@@ -621,6 +622,7 @@ subroutine check_build_vals()
621
622
622
623
end subroutine check_build_vals
623
624
625
+ ! > Print help text and stop
624
626
subroutine printhelp (lines )
625
627
character (len= :),intent (in ),allocatable :: lines(:)
626
628
integer :: iii,ii
@@ -632,6 +634,7 @@ subroutine printhelp(lines)
632
634
write (stdout,' (a)' )' <WARNING> *printhelp* output requested is empty'
633
635
endif
634
636
endif
637
+ stop
635
638
end subroutine printhelp
636
639
637
640
end subroutine get_command_line_settings
0 commit comments