@@ -192,9 +192,9 @@ module fpm_command_line
192
192
subroutine get_command_line_settings (cmd_settings )
193
193
class(fpm_cmd_settings), allocatable , intent (out ) :: cmd_settings
194
194
195
+ integer , parameter :: widest = 256
195
196
character (len= 4096 ) :: cmdarg
196
197
integer :: i
197
- integer :: widest
198
198
integer :: os
199
199
logical :: unix
200
200
type (fpm_install_settings), allocatable :: install_settings
@@ -434,7 +434,6 @@ subroutine get_command_line_settings(cmd_settings)
434
434
elseif (unnamed(2 )==' manual' )then
435
435
unnamed= manual
436
436
endif
437
- widest= 256
438
437
allocate (character (len= widest) :: help_text(0 ))
439
438
do i= 2 ,size (unnamed)
440
439
select case (unnamed(i))
@@ -507,10 +506,12 @@ subroutine get_command_line_settings(cmd_settings)
507
506
call set_args(common_args // ' &
508
507
& --list F&
509
508
&' , help_list, version_text)
510
- call printhelp(help_list_nodash)
511
509
if (lget(' list' ))then
512
- call printhelp(help_list_dash)
510
+ help_text = [character (widest) :: help_list_nodash, help_list_dash]
511
+ else
512
+ help_text = help_list_nodash
513
513
endif
514
+ call printhelp(help_text)
514
515
515
516
case (' test' )
516
517
call set_args(common_args // compiler_args // run_args // ' --' , &
@@ -592,23 +593,23 @@ subroutine get_command_line_settings(cmd_settings)
592
593
593
594
if (cmdarg.ne. ' ' .and. which(' fpm-' // cmdarg).ne. ' ' )then
594
595
call run(' fpm-' // trim (cmdarg)// ' ' // get_command_arguments_quoted(),.false. )
596
+ stop
595
597
else
596
598
call set_args(' &
597
599
& --list F&
598
600
&' , help_fpm, version_text)
599
601
! Note: will not get here if --version or --usage or --help
600
602
! is present on commandline
601
- help_text= help_usage
602
603
if (lget(' list' ))then
603
- help_text= help_list_dash
604
+ help_text = help_list_dash
604
605
elseif (len_trim (cmdarg)==0 )then
605
606
write (stdout,' (*(a))' )' Fortran Package Manager:'
606
607
write (stdout,' (*(a))' )' '
607
- call printhelp(help_list_nodash)
608
+ help_text = [ character (widest) :: help_list_nodash, help_usage]
608
609
else
609
610
write (stderr,' (*(a))' )' <ERROR> unknown subcommand [' , &
610
611
& trim (cmdarg), ' ]'
611
- call printhelp(help_list_dash)
612
+ help_text = [ character (widest) :: help_list_dash, help_usage]
612
613
endif
613
614
call printhelp(help_text)
614
615
endif
@@ -638,6 +639,7 @@ subroutine check_build_vals()
638
639
639
640
end subroutine check_build_vals
640
641
642
+ ! > Print help text and stop
641
643
subroutine printhelp (lines )
642
644
character (len= :),intent (in ),allocatable :: lines(:)
643
645
integer :: iii,ii
@@ -649,6 +651,7 @@ subroutine printhelp(lines)
649
651
write (stdout,' (a)' )' <WARNING> *printhelp* output requested is empty'
650
652
endif
651
653
endif
654
+ stop
652
655
end subroutine printhelp
653
656
654
657
end subroutine get_command_line_settings
0 commit comments