Skip to content
Merged
Show file tree
Hide file tree
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 @@ -28,6 +28,7 @@

import static com.crowdin.cli.BaseCli.RESOURCE_BUNDLE;
import static com.crowdin.cli.utils.console.ExecutionStatus.OK;
import static com.crowdin.cli.utils.console.ExecutionStatus.WARNING;
import static com.crowdin.client.distributions.model.ExportMode.DEFAULT;

@AllArgsConstructor
Expand All @@ -53,6 +54,13 @@ public void act(Outputter out, ProjectProperties pb, ClientDistribution client)
);
boolean isStringsBasedProject = Objects.equals(project.getType(), Type.STRINGS_BASED);

if (exportMode != null) {
out.println(WARNING.withIcon(RESOURCE_BUNDLE.getString("warning.distribution.deprecated_export_mode")));
}
if (files != null) {
out.println(WARNING.withIcon(RESOURCE_BUNDLE.getString("warning.distribution.deprecated_file")));
}
Comment thread
andrii-bodnar marked this conversation as resolved.

if (isStringsBasedProject && exportMode != null) {
throw new ExitCodeExceptionMapper.ValidationException(RESOURCE_BUNDLE.getString("error.distribution.strings_based_export_mode"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ public void act(Outputter out, ProjectProperties pb, ClientDistribution client)
}
String existingExportMode = foundDistribution.get().getExportMode();

if (exportMode != null) {
out.println(ExecutionStatus.WARNING.withIcon(RESOURCE_BUNDLE.getString("warning.distribution.deprecated_export_mode")));
}
if (files != null) {
out.println(ExecutionStatus.WARNING.withIcon(RESOURCE_BUNDLE.getString("warning.distribution.deprecated_file")));
}

List<PatchRequest> requests = new ArrayList<>();

if (name != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class DistributionAddSubcommand extends ActCommandDistribution {
@CommandLine.Parameters(descriptionKey = "crowdin.distribution.add.name")
protected String name;

@CommandLine.Option(names = {"--export-mode"}, paramLabel = "...", descriptionKey = "crowdin.distribution.add.export-mode", defaultValue = "default", order = -2)
@CommandLine.Option(names = {"--export-mode"}, paramLabel = "...", descriptionKey = "crowdin.distribution.add.export-mode", order = -2, hidden = true)
protected ExportMode exportMode;

@CommandLine.Option(names = {"--file"}, paramLabel = "...", descriptionKey = "crowdin.distribution.add.file", order = -2)
@CommandLine.Option(names = {"--file"}, paramLabel = "...", descriptionKey = "crowdin.distribution.add.file", order = -2, hidden = true)
protected List<String> files;

@CommandLine.Option(names = {"--bundle-id"}, paramLabel = "...", descriptionKey = "crowdin.distribution.add.bundle-id", order = -2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class DistributionEditSubcommand extends ActCommandDistribution {
@CommandLine.Option(names = {"--name"}, paramLabel = "...", descriptionKey = "crowdin.distribution.edit.name", order = -2)
protected String name;

@CommandLine.Option(names = {"--export-mode"}, paramLabel = "...", descriptionKey = "crowdin.distribution.edit.export-mode", order = -2)
@CommandLine.Option(names = {"--export-mode"}, paramLabel = "...", descriptionKey = "crowdin.distribution.edit.export-mode", order = -2, hidden = true)
protected ExportMode exportMode;

@CommandLine.Option(names = {"--file"}, paramLabel = "...", descriptionKey = "crowdin.distribution.edit.file", order = -2)
@CommandLine.Option(names = {"--file"}, paramLabel = "...", descriptionKey = "crowdin.distribution.edit.file", order = -2, hidden = true)
protected List<String> files;

@CommandLine.Option(names = {"--bundle-id"}, paramLabel = "...", descriptionKey = "crowdin.distribution.edit.bundle-id", order = -2)
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/messages/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ error.distribution.incorrect_bundle_id_command_usage=The '--bundle-id' is used o
error.distribution.strings_based_export_mode=String-based projects do not support export mode setting
error.distribution.no_edit=Specify the parameters to edit the distribution
error.distribution.not_found=Couldn't find distribution with the specified hash %s
warning.distribution.deprecated_export_mode=The '--export-mode' option is deprecated and will be removed in the next major release. Use '--bundle-id' instead
warning.distribution.deprecated_file=The '--file' option is deprecated and will be removed in the next major release. Use '--bundle-id' instead

error.pre_translate.directory_or_file_only=Either '--file' or '--directory' can be specified
error.pre_translate.engine_id=Machine Translation should be used with the '--engine-id' parameter
Expand Down
Loading