Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-161

provide an easy implementation of "public static void main(String[] args)" for a single command (i.e. for non-shells)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0
    • karaf
    • None

    Description

      Folks should be able to write a command which also has a main inside it which can be invoked directly without a shell with sub commands. e.g. if I did

      public class MyCommand extends Action { 
        ...
      
        public static void main(String[] args) {
          SomeHelperClass.run(MyCommand.class, args);
        }
      

      then its a trivial 1 liner to turn any command into a Main as well if folks want to use it in their IDE/maven/IDE, make an executable jar or whatever. The same class would be reusable inside a shell too (with @Command etc)

      Attachments

        Activity

          People

            Unassigned Unassigned
            jstrachan James Strachan
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: