Commit 2bda4703 authored by John van Groningen's avatar John van Groningen

Merge branch 'extend-paths-cpm' into 'master'

cpm: Support adding multiple paths

See merge request !4
parents 0138914b 26e70fb7
Pipeline #17646 passed with stage
in 52 seconds
...@@ -26,7 +26,7 @@ from PmTypes import ::Pathname,::Output ...@@ -26,7 +26,7 @@ from PmTypes import ::Pathname,::Output
| ProjectHelp | ProjectHelp
:: PathAction :: PathAction
= AddPathAction String = AddPathAction [String]
| RemovePathAction Int | RemovePathAction Int
| ListPathsAction | ListPathsAction
| MovePathAction Int PathDirection | MovePathAction Int PathDirection
......
...@@ -276,8 +276,8 @@ withProject pwd pn cleanhome f world ...@@ -276,8 +276,8 @@ withProject pwd pn cleanhome f world
* Execute path-related project actions * Execute path-related project actions
*/ */
doProjectPathAction :: String String String Project PathAction *World -> *World doProjectPathAction :: String String String Project PathAction *World -> *World
doProjectPathAction cleanhome pwd pn project (AddPathAction path) world doProjectPathAction cleanhome pwd pn project (AddPathAction paths) world
= doModPaths cleanhome pwd pn project (\t -> [!GetLongPathName path:t!]) world = doModPaths cleanhome pwd pn project (Concat [! GetLongPathName path\\path<-paths !]) world
doProjectPathAction cleanhome pwd pn project (RemovePathAction i) world doProjectPathAction cleanhome pwd pn project (RemovePathAction i) world
= doModPaths cleanhome pwd pn project (RemoveAt i) world = doModPaths cleanhome pwd pn project (RemoveAt i) world
......
...@@ -49,8 +49,8 @@ parse_Project_build_args _ _ _ _ error_cpm_action ...@@ -49,8 +49,8 @@ parse_Project_build_args _ _ _ _ error_cpm_action
= error_cpm_action; = error_cpm_action;
parse_Project_path_args :: ![String] !String -> CpmAction; parse_Project_path_args :: ![String] !String -> CpmAction;
parse_Project_path_args ["add",path] project_name parse_Project_path_args ["add":path] project_name
= Project project_name (ProjectPath (AddPathAction path)); | length path <> 0 = Project project_name (ProjectPath (AddPathAction path));
parse_Project_path_args ["remove",i] project_name parse_Project_path_args ["remove",i] project_name
| size i>0 && only_digits_in_string 0 i | size i>0 && only_digits_in_string 0 i
= Project project_name (ProjectPath (RemovePathAction (toInt i))); = Project project_name (ProjectPath (RemovePathAction (toInt i)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment