aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpm/src/fpm/installer.f908
-rw-r--r--fpm/src/fpm_command_line.f9013
-rw-r--r--fpm/test/help_test/help_test.f905
3 files changed, 17 insertions, 9 deletions
diff --git a/fpm/src/fpm/installer.f90 b/fpm/src/fpm/installer.f90
index 54b796d..ddfc77b 100644
--- a/fpm/src/fpm/installer.f90
+++ b/fpm/src/fpm/installer.f90
@@ -57,7 +57,7 @@ module fpm_installer
character(len=*), parameter :: default_includedir = "include"
!> Default name of the installation prefix on Unix platforms
- character(len=*), parameter :: default_prefix_unix = "/usr/local/bin"
+ character(len=*), parameter :: default_prefix_unix = "/usr/local"
!> Default name of the installation prefix on Windows platforms
character(len=*), parameter :: default_prefix_win = "C:\"
@@ -214,11 +214,7 @@ contains
end if
end if
- if (os_is_unix(self%os)) then
- call self%run(self%copy//' "'//source//'" "'//install_dest//'"', error)
- else
- call self%run(self%copy//' "'//source//'" "'//install_dest//'"', error)
- end if
+ call self%run(self%copy//' "'//source//'" "'//install_dest//'"', error)
if (allocated(error)) return
end subroutine install
diff --git a/fpm/src/fpm_command_line.f90 b/fpm/src/fpm_command_line.f90
index d56e9e1..af96fd9 100644
--- a/fpm/src/fpm_command_line.f90
+++ b/fpm/src/fpm_command_line.f90
@@ -100,7 +100,7 @@ character(len=:), allocatable :: help_new(:), help_fpm(:), help_run(:), &
& help_list(:), help_list_dash(:), help_list_nodash(:)
character(len=20),parameter :: manual(*)=[ character(len=20) ::&
& ' ', 'fpm', 'new', 'build', 'run', &
-& 'test', 'runner', 'update','list', 'help', 'version' ]
+& 'test', 'runner', 'install', 'update', 'list', 'help', 'version' ]
character(len=:), allocatable :: val_runner, val_build, val_compiler
@@ -276,6 +276,8 @@ contains
help_text=[character(len=widest) :: help_text, help_new]
case('build ' )
help_text=[character(len=widest) :: help_text, help_build]
+ case('install' )
+ help_text=[character(len=widest) :: help_text, help_install]
case('run ' )
help_text=[character(len=widest) :: help_text, help_run]
case('test ' )
@@ -578,6 +580,7 @@ contains
' + test Run the tests. ', &
' + help Alternate method for displaying subcommand help. ', &
' + list Display brief descriptions of all subcommands. ', &
+ ' + install Install project ', &
' ', &
' Their syntax is ', &
' ', &
@@ -588,6 +591,7 @@ contains
' [--runner "CMD"] [--compiler COMPILER_NAME] [-- ARGS] ', &
' help [NAME(s)] ', &
' list [--list] ', &
+ ' install [--release] [--no-rebuild] [--prefix PATH] [options] ', &
' ', &
'SUBCOMMAND OPTIONS ', &
' --release Builds or runs in release mode (versus debug mode). fpm(1)', &
@@ -616,6 +620,7 @@ contains
' fpm run ', &
' fpm new --help ', &
' fpm run myprogram --release -- -x 10 -y 20 --title "my title" ', &
+ ' fpm install --prefix ~/.local ', &
' ', &
'SEE ALSO ', &
' ', &
@@ -928,9 +933,13 @@ contains
' --no-rebuild do not rebuild project before installation', &
' --prefix DIR path to installation directory (requires write access)', &
' --bindir DIR subdirectory to place executables in', &
- ' --libdir DIR subdirectory to place libraries and archies in', &
+ ' --libdir DIR subdirectory to place libraries and archives in', &
' --includedir DIR subdirectory to place headers and module files in', &
' --verbose print more information', &
+ '', &
+ 'EXAMPLES', &
+ ' Install release version of project:', &
+ ' fpm install --release --prefix ~/.local', &
'' ]
end subroutine set_help
diff --git a/fpm/test/help_test/help_test.f90 b/fpm/test/help_test/help_test.f90
index eb452b1..b9c1645 100644
--- a/fpm/test/help_test/help_test.f90
+++ b/fpm/test/help_test/help_test.f90
@@ -27,6 +27,7 @@ character(len=*),parameter :: cmds(*) = [character(len=80) :: &
'fpm run -- help run >> fpm_scratch_help.txt',&
'fpm run -- help test >> fpm_scratch_help.txt',&
'fpm run -- help runner >> fpm_scratch_help.txt',&
+'fpm run -- help install >> fpm_scratch_help.txt',&
'fpm run -- help list >> fpm_scratch_help.txt',&
'fpm run -- help help >> fpm_scratch_help.txt',&
'fpm run -- --version >> fpm_scratch_help.txt',&
@@ -39,6 +40,7 @@ character(len=*),parameter :: cmds(*) = [character(len=80) :: &
'fpm run --release -- help run >> fpm_scratch_help3.txt',&
'fpm run --release -- help test >> fpm_scratch_help3.txt',&
'fpm run --release -- help runner >> fpm_scratch_help3.txt',&
+'fpm run --release -- help install >> fpm_scratch_help3.txt',&
'fpm run --release -- help list >> fpm_scratch_help3.txt',&
'fpm run --release -- help help >> fpm_scratch_help3.txt',&
'fpm run --release -- --version >> fpm_scratch_help3.txt',&
@@ -48,7 +50,8 @@ character(len=*),parameter :: cmds(*) = [character(len=80) :: &
!'fpm run >> fpm_scratch_help.txt',&
!'fpm run -- --list >> fpm_scratch_help.txt',&
!'fpm run -- list --list >> fpm_scratch_help.txt',&
-character(len=*),parameter :: names(*)=[character(len=10) :: 'fpm','new','update','build','run','test','runner','list','help']
+character(len=*),parameter :: names(*)=[character(len=10) ::&
+ 'fpm','new','update','build','run','test','runner','install','list','help']
character(len=:),allocatable :: add
write(*,'(g0:,1x)')'<INFO>TEST help SUBCOMMAND STARTED'