Commit 26e70fb7 authored by Mart Lubbers's avatar Mart Lubbers

cpm: Support adding multiple paths

parent 0138914b
Pipeline #17643 passed with stage
in 55 seconds
......@@ -26,7 +26,7 @@ from PmTypes import ::Pathname,::Output
| ProjectHelp
:: PathAction
= AddPathAction String
= AddPathAction [String]
| RemovePathAction Int
| ListPathsAction
| MovePathAction Int PathDirection
......
......@@ -276,8 +276,8 @@ withProject pwd pn cleanhome f world
* Execute path-related project actions
*/
doProjectPathAction :: String String String Project PathAction *World -> *World
doProjectPathAction cleanhome pwd pn project (AddPathAction path) world
= doModPaths cleanhome pwd pn project (\t -> [!GetLongPathName path:t!]) world
doProjectPathAction cleanhome pwd pn project (AddPathAction paths) world
= doModPaths cleanhome pwd pn project (Concat [! GetLongPathName path\\path<-paths !]) world
doProjectPathAction cleanhome pwd pn project (RemovePathAction i) world
= doModPaths cleanhome pwd pn project (RemoveAt i) world
......
......@@ -49,8 +49,8 @@ parse_Project_build_args _ _ _ _ error_cpm_action
= error_cpm_action;
parse_Project_path_args :: ![String] !String -> CpmAction;
parse_Project_path_args ["add",path] project_name
= Project project_name (ProjectPath (AddPathAction path));
parse_Project_path_args ["add":path] project_name
| length path <> 0 = Project project_name (ProjectPath (AddPathAction path));
parse_Project_path_args ["remove",i] project_name
| size i>0 && only_digits_in_string 0 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