aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurence Kedward <laurence.kedward@bristol.ac.uk>2021-06-21 12:09:53 +0100
committerGitHub <noreply@github.com>2021-06-21 12:09:53 +0100
commit0372313a91263789c843623fca0aab9a4e340e19 (patch)
treee780354903bee004157a97b1f7cb583baca93a6a
parente6688d07c5658b1a26354be7d7aea68231679f05 (diff)
parent21c6fe6098fe83cb9e3f93983c9339e0fc8d5758 (diff)
downloadfpm-0372313a91263789c843623fca0aab9a4e340e19.tar.gz
fpm-0372313a91263789c843623fca0aab9a4e340e19.zip
Merge pull request #497 from urbanjost/equal
correct for equal sign in flag options to fix #495
-rw-r--r--fpm.toml2
-rw-r--r--src/fpm_environment.f902
-rw-r--r--test/cli_test/cli_test.f904
3 files changed, 5 insertions, 3 deletions
diff --git a/fpm.toml b/fpm.toml
index 1f28116..568754c 100644
--- a/fpm.toml
+++ b/fpm.toml
@@ -12,7 +12,7 @@ rev = "2f5eaba864ff630ba0c3791126a3f811b6e437f3"
[dependencies.M_CLI2]
git = "https://github.com/urbanjost/M_CLI2.git"
-rev = "1f3b922ce35f105d1a51869bed9a1013b5b552b6"
+rev = "ea6bbffc1c2fb0885e994d37ccf0029c99b19f24"
[[test]]
name = "cli-test"
diff --git a/src/fpm_environment.f90 b/src/fpm_environment.f90
index ef0177f..a3c073f 100644
--- a/src/fpm_environment.f90
+++ b/src/fpm_environment.f90
@@ -217,6 +217,8 @@ contains
elseif(ilength.gt.0)then
if(index(arg//' ','-').ne.1)then
args=args//quote//arg//quote//' '
+ elseif(index(arg,' ').ne.0)then
+ args=args//quote//arg//quote//' '
else
args=args//arg//' '
endif
diff --git a/test/cli_test/cli_test.f90 b/test/cli_test/cli_test.f90
index d979f1a..e23afde 100644
--- a/test/cli_test/cli_test.f90
+++ b/test/cli_test/cli_test.f90
@@ -53,7 +53,7 @@ character(len=*),parameter :: tests(*)= [ character(len=256) :: &
'CMD="run proj1 p2 project3 --profile debug", NAME="proj1","p2","project3",profile="debug",', &
'CMD="run proj1 p2 project3 --profile release", NAME="proj1","p2","project3",profile="release",', &
'CMD="run proj1 p2 project3 --profile release -- arg1 -x ""and a long one""", &
- &NAME="proj1","p2","project3",profile="release",ARGS="""arg1"" -x ""and a long one""", ', &
+ &NAME="proj1","p2","project3",profile="release",ARGS="""arg1"" ""-x"" ""and a long one""", ', &
'CMD="test", ', &
'CMD="test my_project", NAME="my_project", ', &
@@ -61,7 +61,7 @@ character(len=*),parameter :: tests(*)= [ character(len=256) :: &
'CMD="test proj1 p2 project3 --profile debug", NAME="proj1","p2","project3",profile="debug",', &
'CMD="test proj1 p2 project3 --profile release", NAME="proj1","p2","project3",profile="release",', &
'CMD="test proj1 p2 project3 --profile release -- arg1 -x ""and a long one""", &
- &NAME="proj1","p2","project3",profile="release" ARGS="""arg1"" -x ""and a long one""", ', &
+ &NAME="proj1","p2","project3",profile="release" ARGS="""arg1"" ""-x"" ""and a long one""", ', &
'CMD="build", NAME= profile="",ARGS="",', &
'CMD="build --profile release", NAME= profile="release",ARGS="",', &