@@ -31,7 +31,8 @@ module fpm_command_line
31
31
use fpm_strings, only : lower, split, fnv_1a, to_fortran_name, is_fortran_name
32
32
use fpm_filesystem, only : basename, canon_path, which
33
33
use fpm_environment, only : run, get_command_arguments_quoted
34
- use fpm_compiler, only : get_default_compile_flags
34
+ use fpm_compiler, only : get_default_compile_flags
35
+ use fpm_error, only : fpm_stop
35
36
use ,intrinsic :: iso_fortran_env, only : stdin= >input_unit, &
36
37
& stdout= >output_unit, &
37
38
& stderr= >error_unit
@@ -139,7 +140,6 @@ subroutine get_command_line_settings(cmd_settings)
139
140
end select
140
141
version_text = [character (len= 80 ) :: &
141
142
& ' Version: 0.3.0, alpha' , &
142
- & ' PR: 511' , &
143
143
& ' Program: fpm(1)' , &
144
144
& ' Description: A Fortran package manager and build system' , &
145
145
& ' Home Page: https://github.com/fortran-lang/fpm' , &
@@ -245,25 +245,23 @@ subroutine get_command_line_settings(cmd_settings)
245
245
& help_new, version_text)
246
246
select case (size (unnamed))
247
247
case (1 )
248
- write (stderr,' (*(g0,/))' )' <ERROR> directory name required'
249
248
write (stderr,' (*(7x,g0,/))' ) &
250
249
& ' <USAGE> fpm new NAME [[--lib|--src] [--app] [--test] [--example]]|[--full|--bare] [--backfill]'
251
- stop 1
250
+ call fpm_stop( 1 , ' directory name required ' )
252
251
case (2 )
253
252
name= trim (unnamed(2 ))
254
253
case default
255
- write (stderr,' (g0)' )' <ERROR> only one directory name allowed'
256
254
write (stderr,' (7x,g0)' ) &
257
255
& ' <USAGE> fpm new NAME [[--lib|--src] [--app] [--test] [--example]]| [--full|--bare] [--backfill]'
258
- stop 2
256
+ call fpm_stop( 2 , ' only one directory name allowed ' )
259
257
end select
260
258
! *! canon_path is not converting ".", etc.
261
259
name= canon_path(name)
262
260
if ( .not. is_fortran_name(to_fortran_name(basename(name))) )then
263
261
write (stderr,' (g0)' ) [ character (len= 72 ) :: &
264
262
& ' <ERROR> the fpm project name must be made of up to 63 ASCII letters,' , &
265
263
& ' numbers, underscores, or hyphens, and start with a letter.' ]
266
- stop 4
264
+ call fpm_stop( 4 , ' ' )
267
265
endif
268
266
269
267
allocate (fpm_new_settings :: cmd_settings)
@@ -272,13 +270,13 @@ subroutine get_command_line_settings(cmd_settings)
272
270
write (stderr,' (*(a))' )&
273
271
&' <ERROR> --full and any of [--src|--lib,--app,--test,--example,--bare]' , &
274
272
&' are mutually exclusive.'
275
- stop 5
273
+ call fpm_stop( 5 , ' ' )
276
274
elseif (any ( specified([character (len= 10 ) :: ' src' ,' lib' ,' app' ,' test' ,' example' ,' full' ])) &
277
275
& .and. lget(' bare' ) )then
278
276
write (stderr,' (*(a))' )&
279
277
&' <ERROR> --bare and any of [--src|--lib,--app,--test,--example,--full]' , &
280
278
&' are mutually exclusive.'
281
- stop 3
279
+ call fpm_stop( 3 , ' ' )
282
280
elseif (any ( specified([character (len= 10 ) :: ' src' ,' lib' ,' app' ,' test' ,' example' ]) ) )then
283
281
cmd_settings= fpm_new_settings(&
284
282
& backfill= lget(' backfill' ), &
0 commit comments