Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,26 @@ private static final class Options implements ArgumentReceiver {
static final String FLATTEN_OPTION = "--flatten";
private boolean flatten = false;

static final String INCLUDE_PRELUDE_OPTION = "--include-prelude";
private boolean includePrelude = false;

@Override
public boolean testOption(String name) {
if (FLATTEN_OPTION.equals(name)) {
flatten = true;
return true;
}
if (INCLUDE_PRELUDE_OPTION.equals(name)) {
includePrelude = true;
return true;
}
return false;
}

@Override
public void registerHelp(HelpPrinter printer) {
printer.option(FLATTEN_OPTION, null, "Flattens and removes mixins from the model.");
printer.option(INCLUDE_PRELUDE_OPTION, null, "Includes the prelude shapes in the model.");
}
}

Expand All @@ -80,8 +88,8 @@ private int runWithClassLoader(SmithyBuildConfig config, Arguments arguments, En
.defaultSeverity(Severity.DANGER)
.build();

ModelSerializer serializer = ModelSerializer.builder().build();
Options options = arguments.getReceiver(Options.class);
ModelSerializer serializer = ModelSerializer.builder().includePrelude(options.includePrelude).build();
if (options.flatten) {
model = ModelTransformer.create().flattenAndRemoveMixins(model);
}
Expand Down
Loading