From 81f791e6cb422acd4595d7d547fa368593874bb6 Mon Sep 17 00:00:00 2001 From: "John S. Urban" Date: Fri, 18 Jun 2021 01:44:23 -0400 Subject: correct for equal sign in flag options --- fpm.toml | 2 +- src/fpm_environment.f90 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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..616af13 100644 --- a/src/fpm_environment.f90 +++ b/src/fpm_environment.f90 @@ -215,8 +215,12 @@ contains write(stderr,'(*(g0,1x))')'*get_command_arguments_stack* error obtaining argument ',i exit elseif(ilength.gt.0)then + !TODO! should escape or double quotes depending on system + !TODO! on some systems might have to do more to requote 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 -- cgit v1.2.3 From bcde251cb03d973914d87abe633351285594b068 Mon Sep 17 00:00:00 2001 From: "John S. Urban" Date: Fri, 18 Jun 2021 02:03:17 -0400 Subject: line 144? --- src/fpm_environment.f90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fpm_environment.f90 b/src/fpm_environment.f90 index 616af13..a3c073f 100644 --- a/src/fpm_environment.f90 +++ b/src/fpm_environment.f90 @@ -215,8 +215,6 @@ contains write(stderr,'(*(g0,1x))')'*get_command_arguments_stack* error obtaining argument ',i exit elseif(ilength.gt.0)then - !TODO! should escape or double quotes depending on system - !TODO! on some systems might have to do more to requote if(index(arg//' ','-').ne.1)then args=args//quote//arg//quote//' ' elseif(index(arg,' ').ne.0)then -- cgit v1.2.3 From 21c6fe6098fe83cb9e3f93983c9339e0fc8d5758 Mon Sep 17 00:00:00 2001 From: "John S. Urban" Date: Fri, 18 Jun 2021 02:18:14 -0400 Subject: change test to match --- test/cli_test/cli_test.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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="",', & -- cgit v1.2.3