diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-03-24 14:10:30 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-03-24 14:10:30 +0000 |
| commit | 04cf66d6b53121998b33889a5495aaef3925cdfd (patch) | |
| tree | 71f827e2486627eb794c3f5b62e74ccab349d5ec /src/main/java/org/shedlang/compiler/cli | |
| parent | cb44def5d662e9ec15cf1d97d735c6deb129c302 (diff) | |
Use profiles when compiling
Diffstat (limited to 'src/main/java/org/shedlang/compiler/cli')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/cli/ShedCli.java | 6 |
1 files changed, 3 insertions, 3 deletions
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.<Command>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); |
