Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update help text and update command output with accurate terms #355

Merged
merged 4 commits into from
Dec 17, 2019
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 @@ -90,7 +90,7 @@ private void remove(String version) {
version.equals(ToolUtil.BALLERINA_TYPE + "-" + ToolUtil.getCurrentBallerinaVersion());
try {
if (isCurrentVersion) {
throw ErrorUtil.createCommandException("The default Ballerina distribution cannot be removed");
throw ErrorUtil.createCommandException("The active Ballerina distribution cannot be removed");
} else {
File directory = new File(ToolUtil.getDistributionsPath() + File.separator + version);
if (directory.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,21 @@ public void setParentCmdParser(CommandLine parentCmdParser) {

public static void update(PrintStream printStream) {
String version = ToolUtil.getCurrentBallerinaVersion();
printStream.println("Fetching the latest distribution version from the remote server...");
printStream.println("Fetching the latest patch version for distribution version '" + version + "' from the " +
"remote server...");
String latestVersion = ToolUtil.getLatest(version, "patch");
if (latestVersion == null) {
printStream.println("Failed to find the latest patch version for distribution version: " + version);
printStream.println("Failed to find the latest patch version for distribution version '" + version + "'");
return;
}
if (!latestVersion.equals(version)) {
String distribution = ToolUtil.BALLERINA_TYPE + "-" + latestVersion;
ToolUtil.downloadDistribution(printStream, distribution, ToolUtil.BALLERINA_TYPE, latestVersion);
ToolUtil.useBallerinaVersion(printStream, distribution);
printStream.println("Updated to the latest Ballerina version: '" + latestVersion + "'");
printStream.println("Successfully set the latest patch version '" + latestVersion + "' as the active " +
"version");
return;
}
printStream.println("The distribution is already in the latest version: " + latestVersion);
printStream.println("The latest patch version '" + latestVersion + "' is already the active version");
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
NAME
ballerina-dist-update - Update to the latest distribution version
ballerina-dist-update - Update to the latest patch version of the
active distribution

SYNOPSIS
ballerina dist update


DESCRIPTION
Dist-update updates Ballerina to the latest distribution version.
Dist-update updates Ballerina to the latest patch version of the
active distribution.


EXAMPLES
Expand Down
17 changes: 10 additions & 7 deletions ballerina-command/src/main/resources/cli-help/ballerina-dist.help
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
NAME
Commands for Ballerina distribution version management
Manage Ballerina distributions

SYNOPSIS
ballerina dist <command> <-h | --help>
ballerina dist <command> [<args>]


DESCRIPTION
Sub-commands to manage Ballerina distributions.
Dist enables you to install, update, and switch among Ballerina distributions
from patch and minor release channels.


OPTIONS
Expand All @@ -17,8 +18,10 @@ OPTIONS

BALLERINA COMMANDS
Here is a list of available sub-commands:
list List available Ballerina distributions
pull Pull and use a given distribution version
use Switch to a specific distribution version
update Update to the latest distribution version
remove Delete a locally installed distribution version
list List installed and available distributions
update Update to the latest patch version of the active distribution
pull Fetch a given distribution and set it as the active version
use Make the specified distribution the active version
remove Delete an installed distribution

See 'ballerina dist <command> -h' for more information on a specific command.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
NAME
ballerina-dist-list - List available Ballerina distributions
ballerina-dist-list - List installed and available distributions

SYNOPSIS
ballerina dist list


DESCRIPTION
Dist-list lists the Ballerina distributions available both locally and remotely.
Dist-list lists the Ballerina distributions available both locally
and remotely.


EXAMPLES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
NAME
ballerina-dist-pull - Pull and use a given distribution version
ballerina-dist-pull - Fetch a given distribution and set it as the
active version

SYNOPSIS
ballerina dist pull <distribution-version>


DESCRIPTION
Dist-pull pulls and uses a given Ballerina version from the remote repository.
Dist-pull fetches a given Ballerina version from the remote repository
and sets it as the active version.


EXAMPLES
Pull and use Ballerina 1.0.0.
Fetch and set Ballerina 1.0.0 as the active version.
→ ballerina dist pull jballerina-1.0.0
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
NAME
ballerina-dist-remove - Remove a given distribution version
ballerina-dist-remove - Delete an installed distribution

SYNOPSIS
ballerina dist remove <distribution-version>


DESCRIPTION
Dist-remove removes the given Ballerina version from the project repository.
Dist-remove removes the given Ballerina version from the project
repository.


EXAMPLES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
NAME
ballerina-dist-use - Use a given distribution version as the default version
ballerina-dist-use - Make the specified distribution the active version

SYNOPSIS
ballerina dist use <distribution-version>


DESCRIPTION
Use switches to a given Ballerina version from the project repository
as the default version.
as the active version.


EXAMPLES
Expand Down