Spring-shell 用法

Spring-shell usage

我正在尝试使用 spring-shell。 创建了这样的 class:

@Component
public class T implements CommandMarker {

public T() {
    System.out.println("T Constructor");
}

@CliCommand(value = "trans", help = "translate")
public String translate(@CliOption(key = { "msg" }, 
    mandatory = false, help = "The hello world message")
    final String msg) {
    System.out.println("!!! " + msg);
    return "!!! " + msg;
  }
}

并有这样的spring-shell-plugin.xml

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans.xsd
   http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-3.1.xsd">   

   <context:component-scan base-package="com" /> 

</beans>

Class 启动应用程序:

public class Main {

public static void main(String[] args) {
    ClassPathXmlApplicationContext context =
            new ClassPathXmlApplicationContext("classpath*:/META-INF/spring/spring-shell-plugin.xml");
    context.start();
}
}

但结果我只是进入控制台 'T Constructor' 虽然我正在传递参数 'trans --msg f'。

如何让它发挥作用?

public static void main(String[] args) throws IOException {
    Bootstrap.main(args);
}