From 916ba70e7eeb18cf8351bee77cba3504dea1c7fc Mon Sep 17 00:00:00 2001 From: Mohamed Ishad Date: Wed, 18 Oct 2023 15:12:52 +0530 Subject: [PATCH] Correct help text for command `bal help` --- misc/formatter/modules/formatter-cli/README.md | 16 ++++++++-------- .../ballerinalang/formatter/cli/Messages.java | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/misc/formatter/modules/formatter-cli/README.md b/misc/formatter/modules/formatter-cli/README.md index e4a7e0524673..bce6494f5428 100644 --- a/misc/formatter/modules/formatter-cli/README.md +++ b/misc/formatter/modules/formatter-cli/README.md @@ -8,11 +8,11 @@ according to the default [Ballerina style guide](https://github.com/ballerina-pl The Ballerina format command can be used to format Ballerina source files. ```sh -$ ballerina format --help +$ bal format --help Prints the help guide for the Ballerina format tool. Usage: -ballerina format [ | ] [-d | --dry-run] +bal format [ | ] [-d | --dry-run] ballerinaFile: Path of a single Ballerina source file, which needs to be formatted. moduleName: @@ -29,26 +29,26 @@ Flags: **Example 1:** Formats all the Ballerina source files in a Ballerina project. ```sh -$ ballerina format +$ bal format ``` This command should be executed from the root of the Ballerina project. **Example 2:** Formats all the Ballerina source files in a Ballerina module. ```sh -$ ballerina format module1 +$ bal format module1 ``` This command should be executed from the root of the Ballerina project. **Example 3:** Formats a single Ballerina source file. ```sh -$ ballerina format hello.bal +$ bal format hello.bal ``` **Example 4:** Performs a dry run of the formatter to see which files will be formatted if executed. ```sh -$ ballerina format -d -$ ballerina format module1 -d -$ ballerina format hello.bal -d +$ bal format -d +$ bal format module1 -d +$ bal format hello.bal -d ``` diff --git a/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/Messages.java b/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/Messages.java index 0a75c6b7d4fd..44540cd363aa 100644 --- a/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/Messages.java +++ b/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/Messages.java @@ -24,15 +24,15 @@ public class Messages { private static final String ARGUMENT_ERROR = "too many arguments." + System.lineSeparator() + "usage: only one argument, either a ballerina file name or a module " + "name, can be applied at a time with or without the option." + System.lineSeparator() - + "i.e: ballerina format [ballerinaFile | ModuleName] [-d | --dry-run]" + System.lineSeparator() - + System.lineSeparator() + "run `ballerina format -h` for more details."; + + "i.e: bal format [ballerinaFile | ModuleName] [-d | --dry-run]" + System.lineSeparator() + + System.lineSeparator() + "run `bal format -h` for more details."; private static final String SUCCESS_MESSAGE = "format successful."; private static final String NOT_BALLERINA_PROJECT = "not a valid Ballerina project." + System.lineSeparator() - + "usage: ballerina format should be run inside a ballerina project or pass in a ballerina file." - + System.lineSeparator() + "i.e. `ballerina format `" - + System.lineSeparator() + System.lineSeparator() + "run `ballerina format -h` for more details"; + + "usage: bal format should be run inside a ballerina project or pass in a ballerina file." + + System.lineSeparator() + "i.e. `bal format `" + + System.lineSeparator() + System.lineSeparator() + "run `bal format -h` for more details"; private static final String NO_MODULE_FOUND = "couldn't find an existing module by the name: "; @@ -42,7 +42,7 @@ public class Messages { private static final String NOT_BALLERINA_FILE = "not a valid ballerina source file." + System.lineSeparator() + "usage: ballerina source files should have the file extension as `.bal`." + System.lineSeparator() - + "i.e. `ballerina format hello.bal`"; + + "i.e. `bal format hello.bal`"; private static final String NO_BALLERINA_FILE_OR_MODULE = "couldn't find an existing ballerina file or " + "module by the name: ";