Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-75

Option shortName attribute doesn't work in forge shell

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • 1.0.6.Final
    • 1.0.0.Alpha2
    • UI - Shell
    • None

    Description

      The Option shortName property in a plugin does not work as advertised in the reference guide.

      Creating the example plugin from the "3.5.1. --named options" chapter:

      public class ExamplePlugin implements Plugin {
      @Command("perform")
      public void exampleCommand(
      @Option(name="one", shortName="o") String one,
      @Option(name="two") String two,
      PipeOut out)

      { out.println(">> option one equals: " + one); out.println(">> option two equals: " + two); }

      }

      Trying to use the shortName for the first argument doesn't work:

      [no project] tmp $ exampleplugin perform -o one --two two
      **INFO** The command [perform] takes [0] unnamed argument(s), but found [1].
      **INFO** Swallowed unknown token [one] for command [perform].
      >> option one equals: null
      >> option two equals: two

      Attachments

        Activity

          People

            rhn-support-ggastald George Gastaldi
            maschmid@redhat.com Marek Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: