@@ -152,6 +152,7 @@ subroutine get_command_line_settings(cmd_settings)
152
152
call set_args(' &
153
153
& --target " " &
154
154
& --list F &
155
+ & --all F &
155
156
& --release F&
156
157
& --example F&
157
158
& --runner " " &
@@ -167,13 +168,26 @@ subroutine get_command_line_settings(cmd_settings)
167
168
names= [character (len= len (names)) :: ]
168
169
endif
169
170
171
+
170
172
if (specified(' target' ) )then
171
173
call split(sget(' target' ),tnames,delimiters= ' ,:' )
172
174
names= [character (len= max (len (names),len (tnames))) :: names,tnames]
173
175
endif
174
176
177
+ ! convert --all to '*'
178
+ if (lget(' all' ))then
179
+ names= [character (len= max (len (names),1 )) :: names,' *' ]
180
+ endif
181
+
182
+ ! convert special string '..' to equivalent (shorter) '*'
183
+ ! to allow for a string that does not require shift-key and quoting
184
+ do i= 1 ,size (names)
185
+ if (names(i).eq. ' ..' )names(i)= ' *'
186
+ enddo
187
+
175
188
allocate (fpm_run_settings :: cmd_settings)
176
189
val_runner= sget(' runner' )
190
+ if (specified(' runner' ) .and. val_runner.eq. ' ' )val_runner= ' echo'
177
191
cmd_settings= fpm_run_settings(&
178
192
& args= remaining,&
179
193
& build_name= val_build,&
@@ -375,8 +389,15 @@ subroutine get_command_line_settings(cmd_settings)
375
389
names= [character (len= max (len (names),len (tnames))) :: names,tnames]
376
390
endif
377
391
392
+ ! convert special string '..' to equivalent (shorter) '*'
393
+ ! to allow for a string that does not require shift-key and quoting
394
+ do i= 1 ,size (names)
395
+ if (names(i).eq. ' ..' )names(i)= ' *'
396
+ enddo
397
+
378
398
allocate (fpm_test_settings :: cmd_settings)
379
399
val_runner= sget(' runner' )
400
+ if (specified(' runner' ) .and. val_runner.eq. ' ' )val_runner= ' echo'
380
401
cmd_settings= fpm_test_settings(&
381
402
& args= remaining, &
382
403
& build_name= val_build, &
@@ -501,8 +522,8 @@ subroutine set_help()
501
522
' [--full|--bare][--backfill] ' , &
502
523
' update [NAME(s)] [--fetch-only] [--clean] [--verbose] ' , &
503
524
' list [--list] ' , &
504
- ' run [[--target] NAME(s)] [--release ] [--runner "CMD" ] [--list ] [--example] ' , &
505
- ' [--compiler COMPILER_NAME] [-- ARGS] ' , &
525
+ ' run [[--target] NAME(s) [--example ] [--release ] [--all ] [--runner "CMD"] ' , &
526
+ ' [--compiler COMPILER_NAME] [--list] [-- ARGS] ' , &
506
527
' test [[--target] NAME(s)] [--release] [--runner "CMD"] [--list] ' , &
507
528
' [--compiler COMPILER_NAME] [-- ARGS] ' , &
508
529
' install [--release] [--no-rebuild] [--prefix PATH] [options] ' , &
@@ -529,7 +550,8 @@ subroutine set_help()
529
550
' OPTION ' , &
530
551
' --runner '' CMD'' quoted command used to launch the fpm(1) executables. ' , &
531
552
' Available for both the "run" and "test" subcommands. ' , &
532
- ' ' , &
553
+ ' If the keyword is specified without a value the default command ' , &
554
+ ' is "echo". ' , &
533
555
' -- SUFFIX_OPTIONS additional options to suffix the command CMD and executable ' , &
534
556
' file names with. ' , &
535
557
' EXAMPLES ' , &
@@ -584,7 +606,7 @@ subroutine set_help()
584
606
' ' , &
585
607
' DESCRIPTION ' , &
586
608
' fpm(1) is a package manager that helps you create Fortran projects ' , &
587
- ' from source. ' , &
609
+ ' from source -- it automatically determines dependencies! ' , &
588
610
' ' , &
589
611
' Most significantly fpm(1) lets you draw upon other fpm(1) packages ' , &
590
612
' in distributed git(1) repositories as if the packages were a basic ' , &
@@ -614,7 +636,7 @@ subroutine set_help()
614
636
' new NAME [[--lib|--src] [--app] [--test] [--example]]| ' , &
615
637
' [--full|--bare][--backfill] ' , &
616
638
' update [NAME(s)] [--fetch-only] [--clean] ' , &
617
- ' run [[--target] NAME(s)] [--release] [--list] [--example] ' , &
639
+ ' run [[--target] NAME(s)] [--release] [--list] [--example] [--all] ' , &
618
640
' [--runner "CMD"] [--compiler COMPILER_NAME] [-- ARGS] ' , &
619
641
' test [[--target] NAME(s)] [--release] [--list] ' , &
620
642
' [--runner "CMD"] [--compiler COMPILER_NAME] [-- ARGS] ' , &
@@ -686,50 +708,60 @@ subroutine set_help()
686
708
' run(1) - the fpm(1) subcommand to run project applications ' , &
687
709
' ' , &
688
710
' SYNOPSIS ' , &
689
- ' fpm run [[--target] NAME(s)] [--release][--compiler COMPILER_NAME] ' , &
690
- ' [--runner "CMD"] [--example] [--list][-- ARGS] ' , &
711
+ ' fpm run [[--target] NAME(s)[--release][--compiler COMPILER_NAME] ' , &
712
+ ' [--runner "CMD"] [--example] [--list] [--all] [-- ARGS] ' , &
691
713
' ' , &
692
714
' fpm run --help|--version ' , &
693
715
' ' , &
694
716
' DESCRIPTION ' , &
695
- ' Run applications you have built in your fpm(1) project. ' , &
696
- ' By default applications specified in as "executable" in your package ' , &
697
- ' manifest are used, alternatively also demonstration programs under ' , &
698
- ' "example" can be used with this subcommand. ' , &
717
+ ' Run the applications in your fpm(1) package. By default applications ' , &
718
+ ' in /app or specified as "executable" in your "fpm.toml" manifest are ' , &
719
+ ' used. Alternatively demonstration programs in example/ or specified in' , &
720
+ ' the "example" section in "fpm.toml" can be executed. The applications ' , &
721
+ ' are automatically rebuilt before being run if they are out of date. ' , &
699
722
' ' , &
700
723
' OPTIONS ' , &
701
- ' --target NAME(s) optional list of specific names to execute. ' , &
702
- ' The default is to run all the applications in app/ ' , &
703
- ' or the programs listed in the "fpm.toml" file. ' , &
704
- ' --example run example programs instead of applications ' , &
705
- ' --release selects the optimized build instead of the debug ' , &
706
- ' build. ' , &
724
+ ' --target NAME(s) list of application names to execute. No name is ' , &
725
+ ' required if only one target exists. If no name is ' , &
726
+ ' supplied and more than one candidate exists or a ' , &
727
+ ' name has no match a list is produced and fpm(1) ' , &
728
+ ' exits. ' , &
729
+ ' ' , &
730
+ ' Basic "globbing" is supported where "?" represents ' , &
731
+ ' any single character and "*" represents any string. ' , &
732
+ ' Note The glob string normally needs quoted to ' , &
733
+ ' the special characters from shell expansion. ' , &
734
+ ' --all Run all examples or applications. An alias for --target '' *'' . ' , &
735
+ ' --example Run example programs instead of applications. ' , &
736
+ ' --release selects the optimized build instead of the debug build. ' , &
707
737
' --compiler COMPILER_NAME Specify a compiler name. The default is ' , &
708
738
' "gfortran" unless set by the environment ' , &
709
739
' variable FPM_COMPILER. ' , &
710
740
' --runner CMD A command to prefix the program execution paths with. ' , &
711
741
' see "fpm help runner" for further details. ' , &
712
- ' --list list candidates instead of building or running them ' , &
713
- ' -- ARGS optional arguments to pass to the program(s). ' , &
714
- ' The same arguments are passed to all names ' , &
715
- ' specified. ' , &
742
+ ' --list list pathname of candidates instead of running them. Note ' , &
743
+ ' out-of-date candidates will still be rebuilt before being ' , &
744
+ ' listed. ' , &
745
+ ' -- ARGS optional arguments to pass to the program(s). The same ' , &
746
+ ' arguments are passed to all program names specified. ' , &
716
747
' ' , &
717
748
' EXAMPLES ' , &
718
- ' fpm(1) " run" project applications ' , &
749
+ ' fpm(1) - run or display project applications: ' , &
719
750
' ' , &
720
- ' # run default programs in /app or as specified in "fpm.toml" ' , &
721
- ' fpm run ' , &
751
+ ' fpm run # run a target when only one exists or list targets ' , &
752
+ ' fpm run --list # list all targets, running nothing. ' , &
753
+ ' fpm run --all # run all targets, no matter how many there are. ' , &
722
754
' ' , &
723
- ' # run default programs in /app or as specified in "fpm.toml" ' , &
724
- ' # using the compiler command "f90". ' , &
755
+ ' # run default program built or to be built with the compiler command ' , &
756
+ ' # "f90". If more than one app exists a list displays and target names' , &
757
+ ' # are required. ' , &
725
758
' fpm run --compiler f90 ' , &
726
759
' ' , &
727
- ' # run example and demonstration programs instead of the default ' , &
728
- ' # application programs (specified in "fpm.toml") ' , &
729
- ' fpm run --example ' , &
760
+ ' # run example programs instead of the application programs. ' , &
761
+ ' fpm run --example '' *'' ' , &
730
762
' ' , &
731
763
' # run a specific program and pass arguments to the command ' , &
732
- ' fpm run mytest -- -x 10 -y 20 --title "my title line" ' , &
764
+ ' fpm run myprog -- -x 10 -y 20 --title "my title line" ' , &
733
765
' ' , &
734
766
' # run production version of two applications ' , &
735
767
' fpm run --target prg1,prg2 --release ' , &
@@ -756,7 +788,7 @@ subroutine set_help()
756
788
' o src/ for modules and procedure source ' , &
757
789
' o app/ main program(s) for applications ' , &
758
790
' o test/ main program(s) and support files for project tests ' , &
759
- ' o example/ main program(s) for examples and demonstrations ' , &
791
+ ' o example/ main program(s) for example programs ' , &
760
792
' Changed or new files found are rebuilt. The results are placed in ' , &
761
793
' the build/ directory. ' , &
762
794
' ' , &
@@ -908,9 +940,9 @@ subroutine set_help()
908
940
' cd myproject # Enter the new directory ' , &
909
941
' # and run commands such as ' , &
910
942
' fpm build ' , &
911
- ' fpm run # run example application program(s) ' , &
943
+ ' fpm run # run lone example application program ' , &
912
944
' fpm test # run example test program(s) ' , &
913
- ' fpm run --example # run example program(s) ' , &
945
+ ' fpm run --example # run lone example program ' , &
914
946
' ' , &
915
947
' fpm new A --full # create example/ and an annotated fpm.toml as well' , &
916
948
' fpm new A --bare # create no directories ' , &
@@ -934,6 +966,11 @@ subroutine set_help()
934
966
' --target NAME(s) optional list of specific test names to execute. ' , &
935
967
' The default is to run all the tests in test/ ' , &
936
968
' or the tests listed in the "fpm.toml" file. ' , &
969
+ ' ' , &
970
+ ' Basic "globbing" is supported where "?" represents ' , &
971
+ ' any single character and "*" represents any string. ' , &
972
+ ' Note The glob string normally needs quoted to ' , &
973
+ ' protect the special characters from shell expansion.' , &
937
974
' --release selects the optimized build instead of the debug ' , &
938
975
' build. ' , &
939
976
' --compiler COMPILER_NAME Specify a compiler name. The default is ' , &
0 commit comments