Commit e7a889a4 authored by Mart Lubbers's avatar Mart Lubbers

support template exporting in cpm

parent 5b47e3d8
Pipeline #24386 passed with stage
in 49 seconds
......@@ -25,6 +25,7 @@ from StdMaybe import :: Maybe
| SetExec String
| SetBytecode (Maybe String)
| SetProjectOptions [ProjectOption]
| ExportTemplate FilePath
| ProjectHelp
:: PathAction
......
......@@ -170,6 +170,13 @@ where
doProjectAction cleanhome pwd pn (SetBytecode (Just bcfile)) world
= withProject pwd pn cleanhome (PR_SetByteCodePath bcfile) world
doProjectAction cleanhome pwd pn (ExportTemplate prt) world
# (project_path, project, ok, world) = openProject pwd pn cleanhome world
| not ok = error "Error opening project" world
# (ok, world) = accFiles (save_project_template_file prt project cleanhome) world
| not ok = error "Error saving project template" world
= world
doProjectAction cleanhome pwd pn (SetProjectOptions project_options) world
= withProject pwd pn cleanhome (set_project_options project_options) world
where
......@@ -242,6 +249,7 @@ doProjectAction _ _ _ _ world =
, " target <env> : set target environment to <env>"
, " exec <execname> : set executable name to <execname>"
, " bytecode [bc] : set bytecode file to <bcfile> or <execname>.bc if no file given"
, " template <template.prt> : export the given project to a template file"
, " set <option> [<option>] : Set one or more of the following options:"
, " : -h SIZE"
, " : Change the heapsize (e.g. 2M)"
......
......@@ -34,6 +34,7 @@ parse_Project ["target",s] project_name = Project project_name (SetTarget s);
parse_Project ["exec",s] project_name = Project project_name (SetExec s);
parse_Project ["bytecode",s] project_name = Project project_name (SetBytecode (Just s));
parse_Project ["bytecode"] project_name = Project project_name (SetBytecode Nothing);
parse_Project ["template",s] project_name = Project project_name (ExportTemplate s);
parse_Project ["set":project_option_args] project_name
# (ok,project_options) = parse_Project_options project_option_args;
| ok
......
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