diff options
author | Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> | 2021-05-27 21:40:35 +0200 |
---|---|---|
committer | Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> | 2021-05-27 21:55:58 +0200 |
commit | 5855337167b53abcaa17452ea1c3c048acb34e09 (patch) | |
tree | 3608de8bbab3ff4a2534b3e7fd4daf1042e6f1a2 /src/fpm_command_line.f90 | |
parent | 3c9e6105c8458f6a59d2edc6fd7f2e79c18de943 (diff) | |
download | fpm-5855337167b53abcaa17452ea1c3c048acb34e09.tar.gz fpm-5855337167b53abcaa17452ea1c3c048acb34e09.zip |
Automatically search for package manifest
Diffstat (limited to 'src/fpm_command_line.f90')
-rw-r--r-- | src/fpm_command_line.f90 | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/fpm_command_line.f90 b/src/fpm_command_line.f90 index 095a533..f44bcd0 100644 --- a/src/fpm_command_line.f90 +++ b/src/fpm_command_line.f90 @@ -26,9 +26,7 @@ module fpm_command_line use fpm_environment, only : get_os_type, get_env, & OS_UNKNOWN, OS_LINUX, OS_MACOS, OS_WINDOWS, & OS_CYGWIN, OS_SOLARIS, OS_FREEBSD, OS_OPENBSD -use fpm_error, only : error_t use M_CLI2, only : set_args, lget, sget, unnamed, remaining, specified -use fpm_os, only : change_directory, get_current_directory use fpm_strings, only : lower, split, fnv_1a use fpm_filesystem, only : basename, canon_path, to_fortran_name use fpm_compiler, only : get_default_compile_flags @@ -48,6 +46,7 @@ public :: fpm_cmd_settings, & get_command_line_settings type, abstract :: fpm_cmd_settings + character(len=:), allocatable :: working_dir logical :: verbose=.true. end type @@ -121,9 +120,7 @@ contains integer :: i integer :: widest type(fpm_install_settings), allocatable :: install_settings - character(len=:), allocatable :: pwd_start, working_dir - character(len=:), allocatable :: common_args - type(error_t), allocatable :: error + character(len=:), allocatable :: common_args, working_dir call set_help() ! text for --version switch, @@ -153,8 +150,6 @@ contains if(adjustl(cmdarg(1:1)) .ne. '-')exit enddo - call get_current_directory(pwd_start) - common_args = '--directory:C " " ' ! now set subcommand-specific help text and process commandline @@ -473,15 +468,9 @@ contains end select - ! Change working directory if requested - working_dir = sget("directory") - if (len_trim(working_dir) > 0) then - call change_directory(working_dir, error) - if (allocated(error)) then - write(stderr, '(*(a, 1x))') "<ERROR>", error%message - stop 1 - end if - write(stdout, '(*(a))') "fpm: Entering directory '"//working_dir//"'" + if (allocated(cmd_settings)) then + working_dir = sget("directory") + call move_alloc(working_dir, cmd_settings%working_dir) end if contains |