From 04cf66d6b53121998b33889a5495aaef3925cdfd Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 24 Mar 2024 14:10:30 +0000 Subject: Use profiles when compiling --- src/main/java/org/shedlang/compiler/cli/ShedCli.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/shedlang/compiler/cli') diff --git a/src/main/java/org/shedlang/compiler/cli/ShedCli.java b/src/main/java/org/shedlang/compiler/cli/ShedCli.java index 5d7baf63..6e5d115b 100644 --- a/src/main/java/org/shedlang/compiler/cli/ShedCli.java +++ b/src/main/java/org/shedlang/compiler/cli/ShedCli.java @@ -9,6 +9,7 @@ import org.shedlang.compiler.errors.CompilerError; import java.io.IOException; import java.nio.file.Paths; +import java.util.Optional; public class ShedCli { public static void main(String[] rawArgs) throws IOException, InterruptedException { @@ -30,7 +31,7 @@ public class ShedCli { switch (args.get("command")) { case COMPILE -> { var backend = Backends.backendForTarget(args.getString("target")); - var profile = args.getString("profile"); + var profile = Optional.ofNullable(args.getString("profile")); compiler.compile(sourcePath, backend, profile); } } @@ -46,8 +47,7 @@ public class ShedCli { compileSubParser.setDefault("command", Command.COMPILE); compileSubParser.addArgument("source").required(true); compileSubParser.addArgument("--target").choices(Backends.targetNames()).required(true); - // TODO: support profiles properly (define profile, allow GC as an option) - compileSubParser.addArgument("--profile").setDefault("mark-and-sweep").required(false); + compileSubParser.addArgument("--profile").required(false); try { return parser.parseArgs(args); -- cgit v1.2.3