Commit 4f22fc33 authored by Jurrien Stutterheim's avatar Jurrien Stutterheim

Fix remove path parsing and display success messages

parent 3ffd1bf8
......@@ -66,7 +66,7 @@ pProject = spstrtok "project" &> pNotSpace <&> \pn -> pProjectAction <@ Project
pPathAction :: CParser Char ProjectAction a
pPathAction = pPathAction <@ ProjectPath
where pPathAction = (spstrtok "add" &> pNotSpace <@ AddPathAction o toString)
<|> (spstrtok "remove" &> nat <@ RemovePathAction)
<|> (spstrtok "remove" &> sp nat <@ RemovePathAction)
<|> (spstrtok "list" <@ const ListPathsAction)
<!> (pHelp PathHelp)
......@@ -181,7 +181,7 @@ doProjectPathAction world cleanhome pn project (AddPathAction path)
# prj = PR_SetPaths False paths (path :! paths) project // TODO: Double check to see if PR_SetPaths is used correctly
# (ok, world) = saveProject cleanhome prj pn world
| not ok = abort "Failed to add path to project" // TODO: Improve
= world
= showLines ["Path '" +++ path +++ "' successfully added to project"] world
doProjectPathAction world cleanhome pn project (RemovePathAction n)
# paths = PR_GetPaths project
......@@ -189,7 +189,7 @@ doProjectPathAction world cleanhome pn project (RemovePathAction n)
# prj = PR_SetPaths False paths paths` project // TODO: Double check to see if PR_SetPaths is used correctly
# (ok, world) = saveProject cleanhome prj pn world
| not ok = abort "Failed to remove path from project" // TODO: Improve
= world
= showLines ["Path " +++ toString n +++ " successfully removed from project"] world
doProjectPathAction world _ _ project ListPathsAction = showLines ["Paths for project:" : paths] world
where paths = map f (zip2 [0..] (StrictListToList (PR_GetPaths project)))
......
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