From da36e23ab9fead4726e203a4549463cf54add7c3 Mon Sep 17 00:00:00 2001 From: Giorgio Garofalo Date: Mon, 29 Jan 2024 20:31:44 +0100 Subject: [PATCH] Rename commands: remove `-` prefix for action commands and set `--` prefix for settings commands --- .github/workflows/maven.yml | 4 +- README.md | 42 +++++++++---------- .../command/commands/CreateSchemeCommand.kt | 4 +- .../commands/DownloadCompilerCommand.kt | 4 +- .../command/commands/ExportSchemeCommand.kt | 4 +- .../pikt/command/commands/HelpCommand.kt | 4 +- .../command/commands/PixelLoggerCommand.kt | 4 +- .../pikt/command/commands/SettingsCommands.kt | 10 ++--- .../command/commands/StringConvertCommand.kt | 4 +- .../pikt/command/commands/WelcomeCommand.kt | 4 +- .../imageprocessing/ChainOutputCommand.kt | 4 +- .../imageprocessing/ColorSwapCommand.kt | 4 +- .../imageprocessing/CompactCommand.kt | 4 +- .../imageprocessing/DecompactCommand.kt | 4 +- .../imageprocessing/ImageOutputCommand.kt | 4 +- .../commands/imageprocessing/MaskCommand.kt | 4 +- .../imageprocessing/RecolorizeCommand.kt | 4 +- .../imageprocessing/StandardizeCommand.kt | 4 +- .../StandardizeDecompactCommand.kt | 4 +- .../pikt/project/PiktProjectInfoParser.kt | 1 - core/src/main/resources/help.yml | 40 +++++++++--------- 21 files changed, 80 insertions(+), 81 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9dcca07..d8c123e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -34,10 +34,10 @@ jobs: rm -rf */target/*-without-dependencies.jar cp */target/*.jar staging mv staging/*lib.jar staging/libraries - - name: Run -welcome + - name: Run welcome command run: | cd staging - java -jar pikt.jar -welcome + java -jar pikt.jar welcome - name: Get output files run: ls -d "$PWD/staging/"* - name: Publish JAR diff --git a/README.md b/README.md index 626e032..dcaef76 100644 --- a/README.md +++ b/README.md @@ -116,25 +116,25 @@ If not specified, points by default to `./libraries/stdlib.jar`; The following arguments enable settings that affect Pikt's behavior. -- `-interpret` runs the generated code via the JVM compiler; +- `--interpret` runs the generated code via the JVM compiler; -- `-printoutput` displays the generated Kotlin code; +- `--printoutput` displays the generated Kotlin code; -- `-nocompile` prevents the generation of any executable file; +- `--nocompile` prevents the generation of any executable file; -- `-pixelinfo` adds information about pixel coordinates to the output code as comments; +- `--pixelinfo` adds information about pixel coordinates to the output code as comments; -- `-imgoutput=path` sets the output file for image-generating commands (see below). If not specified, defaults to the source image path followed by a suffix; +- `--imgoutput=path` sets the output file for image-generating commands (see below). If not specified, defaults to the source image path followed by a suffix; -- `-chainoutput` enables output chaining for image-generating commands: the output of a command becomes the input for the next one. It requires `-imgoutput` to be set. +- `--chainoutput` enables output chaining for image-generating commands: the output of a command becomes the input for the next one. It requires `-imgoutput` to be set. -- `-pl[=type]` sets the active pixel logger type. +- `--pl[=type]` sets the active pixel logger type. A pixel logger is responsible for printing pixels on screen, for example in case of compile-time errors. Available types: `none`, `16`, `256`, `rgb`, `box`. @@ -171,57 +171,57 @@ The following arguments enable settings that affect Pikt's behavior. The following arguments execute tasks and exit when completed. These are handy shortcuts that replace several manual actions, such as image transformations, while being unrelated to code generation and compilation. -- `-downloadcompiler=type[,version]` downloads the zipped Kotlin compiler for the given platform (`jvm`, `windows`, `macos`, `linux`). +- `downloadcompiler=type[,version]` downloads the zipped Kotlin compiler for the given platform (`jvm`, `windows`, `macos`, `linux`). `version` defaults to `1.9.21`. -- `-createscheme` creates a new [color scheme](core/src/main/resources/colors.properties) with default values. +- `createscheme` creates a new [color scheme](core/src/main/resources/colors.properties) with default values. It automatically appends library colors too, e.g. the [stdlib scheme](stdlib/src/main/resources/colors.properties), loaded from `-Dlib`; -- `-exportscheme` generates a useful color palette image out of the given color scheme; +- `exportscheme` generates a useful color palette image out of the given color scheme; -- `-recolorize[=method]` creates a copy of the source image (that relies on the default scheme) and adapts it to a custom scheme (specified by `-Dcolors`). +- `recolorize[=method]` creates a copy of the source image (that relies on the default scheme) and adapts it to a custom scheme (specified by `-Dcolors`). `method` defines the way properties with more than one color are handled; it can be either `first` (default), `last` or `random`; -- `-standardize` creates a copy of the source image (that relies on a custom scheme) and adapts it to the default scheme; +- `standardize` creates a copy of the source image (that relies on a custom scheme) and adapts it to the default scheme; -- `-compact[=size]` creates a compacted copy of the source image with no whitespaces between pixels. +- `compact[=size]` creates a compacted copy of the source image with no whitespaces between pixels. If `size` is not specified, it will try to create a square-ish image. `size` can be defined via `w?h?`, where both `w`and `h` are optional (in case one is missing, it will be calculated the same way as before) (e.g. `w10h5`, `w10`, `h5`); -- `-decompact` creates a decompacted copy of the source image with one statement per line; +- `decompact` creates a decompacted copy of the source image with one statement per line; -- `-standardecompact` runs `-standardize` + `-decompact`; +- `standardecompact` runs `standardize` + `decompact`; -- `-colorswap=` swaps colors from the source image. +- `colorswap=` swaps colors from the source image. `swaps` is defined as `from1:to1,from2:to2,...` where `from` and `to` are hexadecimal colors; -- `-mask=path` creates a masked copy of the source image, loading the mask image from `path`; +- `mask=path` creates a masked copy of the source image, loading the mask image from `path`; -- `-strconvert[=string]` converts a string into a sequence of RGB (grayscale) values supported by Pikt and prints them out. +- `strconvert[=string]` converts a string into a sequence of RGB (grayscale) values supported by Pikt and prints them out. If `string` is not specified, input is read from stdin. _See [Hello world!](https://github.com/iAmGio/pikt/wiki/Hello-world) for further information._ -For instance, `-strconvert="Hello Pikt!"` prints: +For instance, `strconvert="Hello Pikt!"` prints: ``` RGB: 72 101 108 108 111 32 80 105 107 116 33 H e l l o P i k t ! ``` -- `-welcome` runs `-createscheme`, `-exportscheme` (both on `colors`), `-downloadcompiler=jvm` and creates a ready-to-use Hello World source. +- `welcome` runs `createscheme`, `exportscheme` (both on `colors`), `downloadcompiler=jvm` and creates a ready-to-use Hello World source. Its output is already zipped in the downloadable archive; -- `-help` shows these commands. +- `help` shows these commands. More in-depth information about image transformation commands can be found [here](https://github.com/iAmGio/pikt/wiki/Image-transformation-commands). diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/CreateSchemeCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/CreateSchemeCommand.kt index 141830f..5bf9bda 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/CreateSchemeCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/CreateSchemeCommand.kt @@ -11,11 +11,11 @@ import java.io.FileOutputStream import java.io.IOException /** - * Triggered by -createscheme argument + * Triggered by the `createscheme` argument * * @author Giorgio Garofalo */ -class CreateSchemeCommand : Command("-createscheme", closeOnComplete = true) { +class CreateSchemeCommand : Command("createscheme", closeOnComplete = true) { override fun execute(args: String?) { val retriever = PiktPropertiesRetriever() val libraries = retriever.libraries() diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/DownloadCompilerCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/DownloadCompilerCommand.kt index 7c15f1b..91d7fe3 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/DownloadCompilerCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/DownloadCompilerCommand.kt @@ -7,11 +7,11 @@ import eu.iamgio.pikt.util.KotlinCompilerDownloader import eu.iamgio.pikt.util.KotlinCompilerType /** - * Triggered by -downloadcompiler=type[,version] argument + * Triggered by `downloadcompiler=type[,version]` argument * * @author Giorgio Garofalo */ -class DownloadCompilerCommand : Command("-downloadcompiler", closeOnComplete = true) { +class DownloadCompilerCommand : Command("downloadcompiler", closeOnComplete = true) { override fun execute(args: String?) { val type: KotlinCompilerType? val version: String? diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/ExportSchemeCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/ExportSchemeCommand.kt index 29ce9e9..b7c1620 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/ExportSchemeCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/ExportSchemeCommand.kt @@ -12,12 +12,12 @@ import java.io.FileInputStream import java.io.IOException /** - * Triggered by -exportscheme argument. + * Triggered by the `exportscheme` argument. * Creates a color palette. * * @author Giorgio Garofalo */ -class ExportSchemeCommand : Command("-exportscheme", closeOnComplete = true) { +class ExportSchemeCommand : Command("exportscheme", closeOnComplete = true) { override fun execute(args: String?) { val schemeFile = PiktPropertiesRetriever().colorsFile() ?: exit(ERROR_BAD_PROPERTIES, message = "Color scheme (-Dcolors) not set.") diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/HelpCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/HelpCommand.kt index 487ffd9..79ca380 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/HelpCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/HelpCommand.kt @@ -14,12 +14,12 @@ import eu.iamgio.pikt.log.Log private const val HELP_PATH = "/help.yml" /** - * Triggered by the -help argument. + * Triggered by the `help` argument. * Shows command and property information. * * @author Giorgio Garofalo */ -class HelpCommand : Command("-help", closeOnComplete = true) { +class HelpCommand : Command("help", closeOnComplete = true) { /** * Formats some [text] as a title. diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/PixelLoggerCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/PixelLoggerCommand.kt index 782ebed..b1741fb 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/PixelLoggerCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/PixelLoggerCommand.kt @@ -8,13 +8,13 @@ import eu.iamgio.pikt.log.pixel.AsciiBoxConsolePixelLogger import eu.iamgio.pikt.log.pixel.RGBConsolePixelLogger /** - * Triggered by the -pl=type argument. + * Triggered by the `--pl[=type]` argument. * Defines the logger used to log pixels, for example in case of errors. * * @see Log.pixelLogger * @author Giorgio Garofalo */ -class PixelLoggerCommand : Command("-pl", isSettingsCommand = true) { +class PixelLoggerCommand : Command("--pl", isSettingsCommand = true) { override fun execute(args: String?) { Log.pixelLogger = when(args) { diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/SettingsCommands.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/SettingsCommands.kt index a0f0d0d..ebf820c 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/SettingsCommands.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/SettingsCommands.kt @@ -4,7 +4,7 @@ import eu.iamgio.pikt.GlobalSettings import eu.iamgio.pikt.command.Command /** - * A no-arguments command that enables a given property. + * A zero-arguments command that enables a given property. * @author Giorgio Garofalo */ open class SettingsCommand(name: String) : Command(name, isSettingsCommand = true) { @@ -17,22 +17,22 @@ open class SettingsCommand(name: String) : Command(name, isSettingsCommand = tru * Runs the generated code via the JVM compiler. */ class InterpretCommand : SettingsCommand(CMD_INTERPRET) -const val CMD_INTERPRET = "-interpret" +const val CMD_INTERPRET = "--interpret" /** * Prints the output code to console. */ class PrintOutputCommand : SettingsCommand(CMD_PRINTOUTPUT) -const val CMD_PRINTOUTPUT = "-printoutput" +const val CMD_PRINTOUTPUT = "--printoutput" /** * Adds pixel coordinates to the output code. */ class PixelInfoCommand : SettingsCommand(CMD_PIXELINFO) -const val CMD_PIXELINFO = "-pixelinfo" +const val CMD_PIXELINFO = "--pixelinfo" /** * Lets Pikt run and generate code without actually compiling it into an executable. */ class NoCompileCommand : SettingsCommand(CMD_NOCOMPILE) -const val CMD_NOCOMPILE = "-nocompile" \ No newline at end of file +const val CMD_NOCOMPILE = "--nocompile" \ No newline at end of file diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/StringConvertCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/StringConvertCommand.kt index 95d323b..75e52c1 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/StringConvertCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/StringConvertCommand.kt @@ -6,12 +6,12 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.log.pixel.ConsolePixelLogger /** - * Triggered by -strconvert=string argument. + * Triggered by the `strconvert[=string]` argument. * Converts a string into a sequence of RGB values supported by Pikt and prints them out. * * @author Giorgio Garofalo */ -class StringConvertCommand : Command("-strconvert", closeOnComplete = true) { +class StringConvertCommand : Command("strconvert", closeOnComplete = true) { override fun execute(args: String?) { if(args == null) { // Read lines from stdin diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/WelcomeCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/WelcomeCommand.kt index 430deb7..871a311 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/WelcomeCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/WelcomeCommand.kt @@ -12,12 +12,12 @@ import java.io.FileOutputStream private const val HELLO_WORLD = "helloworld.png" /** - * Triggered by -welcome argument. Creates useful initial files for the first run. + * Triggered by `welcome` argument. Creates useful initial files for the first run. * It is also called by the GitHub action before zipping. * * @author Giorgio Garofalo */ -class WelcomeCommand : Command("-welcome", closeOnComplete = true) { +class WelcomeCommand : Command("welcome", closeOnComplete = true) { override fun execute(args: String?) { Log.info("-----\nWelcome to Pikt!\n-----\n") diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ChainOutputCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ChainOutputCommand.kt index 39831a9..4c12b4a 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ChainOutputCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ChainOutputCommand.kt @@ -3,14 +3,14 @@ package eu.iamgio.pikt.command.commands.imageprocessing import eu.iamgio.pikt.command.Command /** - * Triggered by -chainoutput argument. + * Triggered by the `--chainoutput` argument. * Allows chaining between image transformation commands: the output of an image processing command becomes the input for the next command. * It is recommended to use in combination with [ImageOutputCommand]. * * @see ImageProcessingUtils.enableChaining * @author Giorgio Garofalo */ -class ChainOutputCommand : Command("-chainoutput", isSettingsCommand = true) { +class ChainOutputCommand : Command("--chainoutput", isSettingsCommand = true) { override fun execute(args: String?) { ImageProcessingUtils.enableChaining = true } diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ColorSwapCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ColorSwapCommand.kt index 60dfc4e..f30da89 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ColorSwapCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ColorSwapCommand.kt @@ -7,14 +7,14 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.properties.PiktPropertiesRetriever /** - * Triggered by -colorswap= argument, + * Triggered by the `colorswap=` argument, * where `` is a list of `from:to` separated by a comma. * * Example: `-swapcolors=FF0000:FFFF00,00FF00:0000FF` * * @author Giorgio Garofalo */ -class ColorSwapCommand : Command("-colorswap", closeOnComplete = true) { +class ColorSwapCommand : Command("colorswap", closeOnComplete = true) { override fun execute(args: String?) { if(args == null) { Log.error("Usage: -colorswap=. Exiting.") diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/CompactCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/CompactCommand.kt index 8e03371..8557e6c 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/CompactCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/CompactCommand.kt @@ -7,11 +7,11 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.properties.PiktPropertiesRetriever /** - * Triggered by -compact[=size] argument. + * Triggered by the `-compact[=size]` argument. * * @author Giorgio Garofalo */ -class CompactCommand : Command("-compact", closeOnComplete = true) { +class CompactCommand : Command("compact", closeOnComplete = true) { override fun execute(args: String?) { val properties = PiktPropertiesRetriever().retrieve() val piktImage = PiktImage(properties) diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/DecompactCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/DecompactCommand.kt index f433376..7af1a7b 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/DecompactCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/DecompactCommand.kt @@ -7,11 +7,11 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.properties.PiktPropertiesRetriever /** - * Triggered by -decompact argument. + * Triggered by the `-decompact` argument. * * @author Giorgio Garofalo */ -class DecompactCommand : Command("-decompact", closeOnComplete = true) { +class DecompactCommand : Command("decompact", closeOnComplete = true) { override fun execute(args: String?) { val properties = PiktPropertiesRetriever().retrieve() val piktImage = PiktImage(properties) diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ImageOutputCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ImageOutputCommand.kt index 460ab23..413ef3c 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ImageOutputCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/ImageOutputCommand.kt @@ -5,13 +5,13 @@ import eu.iamgio.pikt.log.Log import java.io.File /** - * Triggered by -imgoutput=path argument. + * Triggered by the `--imgoutput=path` argument. * Defines the output file name for the operations in this file. * * @see ImageProcessingUtils.output * @author Giorgio Garofalo */ -class ImageOutputCommand : Command("-imgoutput", isSettingsCommand = true) { +class ImageOutputCommand : Command("--imgoutput", isSettingsCommand = true) { override fun execute(args: String?) { if(args == null) { Log.warn("Expected -imgoutput=. Using default path.") diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/MaskCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/MaskCommand.kt index 3d74858..2cdf689 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/MaskCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/MaskCommand.kt @@ -11,11 +11,11 @@ import java.io.File /** - * Triggered by -mask= argument. + * Triggered by the `mask=` argument. * * @author Giorgio Garofalo */ -class MaskCommand : Command("-mask", closeOnComplete = true) { +class MaskCommand : Command("mask", closeOnComplete = true) { override fun execute(args: String?) { if(args == null) { Log.error("Expected -mask=. Exiting.") diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/RecolorizeCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/RecolorizeCommand.kt index 141adae..6e14585 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/RecolorizeCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/RecolorizeCommand.kt @@ -6,11 +6,11 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.properties.PiktPropertiesRetriever /** - * Triggered by -recolorize[=method] argument. + * Triggered by the `recolorize[=method]` argument. * * @author Giorgio Garofalo */ -class RecolorizeCommand : Command("-recolorize", closeOnComplete = true) { +class RecolorizeCommand : Command("recolorize", closeOnComplete = true) { override fun execute(args: String?) { val properties = PiktPropertiesRetriever().retrieve() val sourceImage = ImageProcessingUtils.read(properties.source) diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeCommand.kt index e1679b6..4ee4a8e 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeCommand.kt @@ -6,11 +6,11 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.properties.PiktPropertiesRetriever /** - * Triggered by -standardize argument. + * Triggered by the `standardize` argument. * * @author Giorgio Garofalo */ -class StandardizeCommand : Command("-standardize", closeOnComplete = true) { +class StandardizeCommand : Command("standardize", closeOnComplete = true) { override fun execute(args: String?) { val properties = PiktPropertiesRetriever().retrieve() val sourceImage = ImageProcessingUtils.read(properties.source) diff --git a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeDecompactCommand.kt b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeDecompactCommand.kt index aae33ed..92b8e45 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeDecompactCommand.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/command/commands/imageprocessing/StandardizeDecompactCommand.kt @@ -8,13 +8,13 @@ import eu.iamgio.pikt.log.Log import eu.iamgio.pikt.properties.PiktPropertiesRetriever /** - * Triggered by -standardecompact argument. + * Triggered by the `standardecompact` argument. * * -standardize + -decompact * * @author Giorgio Garofalo */ -class StandardizeDecompactCommand : Command("-standardecompact", closeOnComplete = true) { +class StandardizeDecompactCommand : Command("standardecompact", closeOnComplete = true) { override fun execute(args: String?) { val properties = PiktPropertiesRetriever().retrieve() val piktImage = PiktImage(properties) diff --git a/core/src/main/kotlin/eu/iamgio/pikt/project/PiktProjectInfoParser.kt b/core/src/main/kotlin/eu/iamgio/pikt/project/PiktProjectInfoParser.kt index 03be600..a3fcf45 100644 --- a/core/src/main/kotlin/eu/iamgio/pikt/project/PiktProjectInfoParser.kt +++ b/core/src/main/kotlin/eu/iamgio/pikt/project/PiktProjectInfoParser.kt @@ -84,7 +84,6 @@ class PiktProjectInfoParser(private val inputStream: InputStream) { val properties = listToMap(propertiesData) val commands = listToMap(commandsData) - .mapKeys { "-" + it.key } // Commands start with a '-', but they don't in the project info file. .mapValues { it.value?.toString() } return PiktProjectInfo(properties, commands, tasks) diff --git a/core/src/main/resources/help.yml b/core/src/main/resources/help.yml index 221784a..786c475 100644 --- a/core/src/main/resources/help.yml +++ b/core/src/main/resources/help.yml @@ -27,11 +27,11 @@ sections: - name: Settings description: Commands that affect Pikt's behavior. members: - - -interpret: Runs the generated code on the fly via the JVM compiler. - - -printoutput: Prints the generated Kotlin code. - - -pixelinfo: Adds information about pixel coordinates to the output code. - - -nocompile: Disables the generation of any executable file. - - -pl[=type]: + - --interpret: Runs the generated code on the fly via the JVM compiler. + - --printoutput: Prints the generated Kotlin code. + - --pixelinfo: Adds information about pixel coordinates to the output code. + - --nocompile: Disables the generation of any executable file. + - --pl[=type]: description: Sets the active pixel logger type. args: - type: @@ -43,23 +43,23 @@ sections: - name: Color schemes description: Utilities for color scheme files. members: - - -createscheme: Creates a new color scheme with default values. - - -exportscheme: Generates a color palette image out of the currently set color scheme. + - createscheme: Creates a new color scheme with default values. + - exportscheme: Generates a color palette image out of the currently set color scheme. - name: Image transformations description: "Commands that transform an image without altering its source content.\n\ They don't affect the image itself but create a copy instead.\n\ More info at https://github.com/iamgio/pikt/wiki/Image-transformation-commands" members: - - -imgoutput=path: + - --imgoutput=path: description: Sets the output file for image transformation commands. default: The source image path followed by a suffix. args: - path: Path of the image files to be created. - - -chainoutput: + - --chainoutput: description: "Enables output chaining: the output of a command becomes input for the next one." note: -imgoutput must be set. - - -recolorize[=method]: + - recolorize[=method]: description: Adapts the source image from the default color scheme to the current one. args: - method: @@ -67,21 +67,21 @@ sections: values: [ first, last, random ] default: first optional: true - - -standardize: Adapts the source image to the current custom color scheme to the default one. - - -compact[=size]: + - standardize: Adapts the source image to the current custom color scheme to the default one. + - compact[=size]: description: Removes whitespace from the source image. args: - size: description: Width and/or height of the final image, e.g. w10h5, w10, h5. default: The optimal size for a square-ish image. optional: true - - -decompact: Adds whitespaces to the source image in order to have one statement per line. - - -standardecompact: -standardize + -decompact. - - -colorswap=swaps: + - decompact: Adds whitespaces to the source image in order to have one statement per line. + - standardecompact: -standardize + -decompact. + - colorswap=swaps: description: Swaps colors from the source image. args: - swaps: Sequence of from:to colors (as hex) separated by commas. - - -mask=path: + - mask=path: description: Gives a shape to the source image. args: - path: Path to the mask image, where the shape is defined by solid pixels. @@ -89,14 +89,14 @@ sections: - name: Misc description: Other commands. members: - - -strconvert[=string]: + - strconvert[=string]: description: Converts a string into a sequence of ready-to-use RGB values. args: - string: description: Text to convert. default: None, will be read from stdin. optional: true - - -downloadcompiler=type[,version]: + - downloadcompiler=type[,version]: description: Downloads the Kotlin compiler for the given platform. args: - type: @@ -106,5 +106,5 @@ sections: description: Version of the Kotlin compiler. default: 1.7.20 optional: true - - -welcome: Runs -createscheme, -exportscheme and -downloadcompiler=jvm. - - -help: Shows available commands. \ No newline at end of file + - welcome: Runs -createscheme, -exportscheme and -downloadcompiler=jvm. + - help: Shows available commands. \ No newline at end of file