diff options
author | John S. Urban <urbanjost@comcast.net> | 2021-02-21 10:53:45 -0500 |
---|---|---|
committer | John S. Urban <urbanjost@comcast.net> | 2021-02-21 10:53:45 -0500 |
commit | 8c55133fd176d22f178cfa0d26258338c23eda0e (patch) | |
tree | 60b752288489410402afbc8ce71cf207d8f0ee91 | |
parent | f2803321f8eef2fcbe6ccaaab8dcaaddcfd76100 (diff) | |
download | fpm-8c55133fd176d22f178cfa0d26258338c23eda0e.tar.gz fpm-8c55133fd176d22f178cfa0d26258338c23eda0e.zip |
Add --all as an alias for --target '*' on "run" subcommand
-rw-r--r-- | fpm/src/fpm.f90 | 4 | ||||
-rw-r--r-- | fpm/src/fpm_command_line.f90 | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90 index f4ca334..ec5e641 100644 --- a/fpm/src/fpm.f90 +++ b/fpm/src/fpm.f90 @@ -296,7 +296,9 @@ subroutine cmd_run(settings,test) ! Check all names are valid ! or no name and found more than one file - if ( any(.not.found) .or. (size(settings%name).eq.0 .and. size(executables).gt.1 .and. .not.test) ) then + if ( any(.not.found) .or. & + & (size(settings%name).eq.0 .and. size(executables).gt.1 .and. .not.test) .and.& + & .not.settings%list) then if(any(.not.found))then write(stderr,'(A)',advance="no")'fpm::run<ERROR> specified names ' do j=1,size(settings%name) diff --git a/fpm/src/fpm_command_line.f90 b/fpm/src/fpm_command_line.f90 index 7260591..637cc74 100644 --- a/fpm/src/fpm_command_line.f90 +++ b/fpm/src/fpm_command_line.f90 @@ -152,6 +152,7 @@ contains call set_args('& & --target " " & & --list F & + & --all F & & --release F& & --example F& & --runner " " & @@ -171,6 +172,9 @@ contains call split(sget('target'),tnames,delimiters=' ,:') names=[character(len=max(len(names),len(tnames))) :: names,tnames] endif + if(lget('all'))then + names=[character(len=max(len(names),1)) :: names,'*'] + endif allocate(fpm_run_settings :: cmd_settings) val_runner=sget('runner') @@ -696,7 +700,7 @@ contains ' By default applications in /app or specified as "executable" in your ', & ' "fpm.toml" manifest are used. Alternatively demonstration programs ', & ' in example/ or specified in the "example" section in "fpm.toml" ', & - ' can be executed with this subcommand. ', & + ' can be executed. ', & ' ', & 'OPTIONS ', & ' --target NAME(s) list of specific application names to execute. ', & @@ -707,6 +711,7 @@ contains ' Simple "globbing" is supported where "?" represents ', & ' any single character and "*" represents any string. ', & ' Therefore a quoted asterisk ''*'' runs all programs. ', & + ' --all An alias for "--target ''*''. All targets are selected. ', & ' --example run example programs instead of applications ', & ' --release selects the optimized build instead of the debug build. ', & ' --compiler COMPILER_NAME Specify a compiler name. The default is ', & |