Skip to content

Restore default command group name as in Spring Shell v3 #1308

@fmbenhassine

Description

@fmbenhassine

This was initially reported in #1281. cc @ullenboom

The way the default group name of commands is derived from the class name has changed compared to v3. Example:

@Command
public class FsCommands {

    @Command
    public String minimumFreeDiskSpace() {
        return "minimumFreeDiskSpace";
    }

    @Command
    public String freeDiskSpace() {
        return "freeDiskSpace";
    }
}

With this class definition, the default group name is Default. When using @ShellComponent and @ShellMethod, the default group name is Fs Commands.

In v4, we append " Commands" to the class name, so we end up with FsCommands Commands. We either need to document that so users know how to name their classes, or just remove it and revert it back to as it was to end up like Fs Commands (which seems to be the most "natural" way of deriving the default group name from a class name, assuming this is clearly documented).

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/need-triageTeam needs to triage and take a first look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions