Skip to content

Commit

Permalink
Grace: use grace as shell app name
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Jan 8, 2024
1 parent d4971d3 commit 102d2db
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class GrailsConsole implements ConsoleLogger {

public static final String CATEGORY_SEPARATOR = "|";

public static final String PROMPT = "grails> ";
public static final String PROMPT = "grace> ";

public static final String SPACE = " ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class GrailsCli {
GrailsVersion currentVersion = GrailsVersion.current()
GrailsDependenciesDependencyManagement grailsDependencies = new GrailsDependenciesDependencyManagement()
StringBuilder sb = new StringBuilder()
sb.append('%n------------------------------------------------------------%nGrails ')
sb.append('%n------------------------------------------------------------%nGrace ')
sb.append(currentVersion.getVersion())
sb.append('%n------------------------------------------------------------%n%nBuild time: ')
sb.append(currentVersion.getBuildTimestamp())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ abstract class AbstractProfile implements Profile {
int requiredArgumentCount = requiredArguments?.findAll { CommandArgument ca -> ca.required }?.size() ?: 0
if (commandLine.remainingArgs.size() < requiredArgumentCount) {
context.console.error "Command [$commandName] missing required arguments: ${requiredArguments*.name}. " +
"Type 'grails help $commandName' for more info."
"Type 'grace help $commandName' for more info."
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ class HelpCommand implements ProfileCommand, Completer, ProjectContextAware, Pro

console.log '''
Usage (optionals marked with *):'
grails [environment]* [target] [arguments]*'
grace [environment]* [target] [arguments]*'
'''
console.addStatus('Examples:')
console.log('$ grails dev run-app')
console.log('$ grails create-app books')
console.log('$ grace dev run-app')
console.log('$ grace create-app blog')
console.log ''
console.addStatus('Available Commands (type grails help \'command-name\' for more info):')
console.addStatus('Available Commands (type grace help \'command-name\' for more info):')
console.addStatus("${'Command Name'.padRight(37)} Command Description")
console.println('-' * 100)
for (CommandDescription desc : allCommands) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ import org.grails.cli.profile.ProfileRepositoryAware
class ListProfilesCommand implements Command, ProfileRepositoryAware {

final String name = 'list-profiles'
final CommandDescription description = new CommandDescription(name, 'Lists the available profiles', 'grails list-profiles')
final CommandDescription description = new CommandDescription(name, 'Lists the available profiles', 'grace list-profiles')

ProfileRepository profileRepository

@Override
boolean handle(ExecutionContext executionContext) {
List<Profile> allProfiles = profileRepository.allProfiles
List<Profile> allProfiles = profileRepository.allProfiles.sort { Profile p -> p.name}
GrailsConsole console = executionContext.console
console.addStatus('Available Profiles')
console.log('--------------------')
console.log('-' * 100)
console.log('Available Profiles')
console.log('-' * 100)
for (Profile p in allProfiles) {
console.log("* $p.name - ${p.description}")
console.log("* ${p.name.padRight(30)} ${p.version.padRight(20)} ${p.description}")
}

true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ class ProfileInfoCommand extends ArgumentCompletingCommand implements ProfileRep
console.error("Profile not found for name [$profileName]")
}
else {
console.log("Profile: ${profile.name}")
console.log('--------------------')
console.log("Profile: ${profile.name} v${profile.version}")
console.log('-' * 40)
console.log(profile.description)
console.log('')
console.log('Provided Commands:')
console.log('--------------------')
console.log('-' * 40)
Iterable<Command> commands = findCommands(profile, console).toUnique { Command c -> c.name }

for (cmd in commands) {
Expand All @@ -83,7 +83,7 @@ class ProfileInfoCommand extends ArgumentCompletingCommand implements ProfileRep
}
console.log('')
console.log('Provided Features:')
console.log('--------------------')
console.log('-' * 40)
Iterable<Feature> features = profile.features

for (feature in features) {
Expand Down

0 comments on commit 102d2db

Please sign in to comment.