Skip to content

CommandContext in shell method #779

Closed
@max91

Description

@max91

Hello, I can’t figure out how to get the CommandСontext in the method.

I am trying this:

@ShellMethod
public String hi(
    CommandContext commandContext
) {
    return "hi";
}

But I don't think this is the right approach. Can you help me?

Using this:

<dependency>
   <groupId>org.springframework.shell</groupId>
   <artifactId>spring-shell-starter</artifactId>
   <version>2.1.10</version>
</dependency>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions