Skip to content

Commit 75e870f

Browse files
committed
allow hypen in fpm new and update the error message
1 parent 2cb994d commit 75e870f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

fpm/src/fpm_command_line.f90

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module fpm_command_line
2828
OS_CYGWIN, OS_SOLARIS, OS_FREEBSD
2929
use M_CLI2, only : set_args, lget, sget, unnamed, remaining, specified
3030
use fpm_strings, only : lower, split
31-
use fpm_filesystem, only : basename, canon_path
31+
use fpm_filesystem, only : basename, canon_path, to_fortran_name
3232
use,intrinsic :: iso_fortran_env, only : stdin=>input_unit, &
3333
& stdout=>output_unit, &
3434
& stderr=>error_unit
@@ -225,13 +225,11 @@ subroutine get_command_line_settings(cmd_settings)
225225
end select
226226
!*! canon_path is not converting ".", etc.
227227
name=canon_path(name)
228-
if( .not.is_fortran_name(basename(name)) )then
228+
if( .not.is_fortran_name(to_fortran_name(basename(name))) )then
229229
write(stderr,'(g0)') [ character(len=72) :: &
230-
& '<ERROR>the new directory basename must be an allowed ', &
231-
& ' Fortran name. It must be composed of 1 to 63 ASCII', &
232-
& ' characters and start with a letter and be composed', &
233-
& ' entirely of alphanumeric characters [a-zA-Z0-9]', &
234-
& ' and underscores.']
230+
& '<ERROR> the fpm project name must be made of ASCII letters', &
231+
& ' numbers, underscores, or hyphens, and no longer ', &
232+
& ' than 63 characters.']
235233
stop 4
236234
endif
237235

0 commit comments

Comments
 (0)