List all possible options

65 views
Skip to first unread message

Rocio Rama

unread,
Dec 1, 2015, 9:08:30 AM12/1/15
to jewelcli
Hello,
Is there any way to print all the possible option with the descriptions?

    @Option(shortName="T", longName="timeout", defaultValue="1000000",
            description="timeout for each removal method invocation in milliseconds")
    @Option(shortName="l", longName="list",
            description="list the names defined in the configuration file")

Is there any function in the documentation that has already implemented it?

Thanks in advance!

Rocio

Tim Wood

unread,
Dec 1, 2015, 9:10:12 AM12/1/15
to jewe...@googlegroups.com

I am not sure if I have understood your question, but perhaps this link will help you http://stackoverflow.com/questions/8115609/output-the-help-message-manually-with-jewelcli

--
You received this message because you are subscribed to the Google Groups "jewelcli" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jewelcli+u...@googlegroups.com.
To post to this group, send email to jewe...@googlegroups.com.
Visit this group at http://groups.google.com/group/jewelcli.
For more options, visit https://groups.google.com/d/optout.

Rocio Rama

unread,
Dec 1, 2015, 2:20:15 PM12/1/15
to jewelcli
What i would like is to show all the information of the options..
For example, if i have:

    @Option(shortName="p", longName="port", defaultValue="1099",
            description="JMX port to connect to")
    void setPort(int port){
        this.port = port;
    };

    @Option(shortName="T", longName="timeout", defaultValue="1000000",
            description="timeout for each removal method invocation in milliseconds")
    void setTimeout(long timeout){
        this.timeout = timeout;
    };


I would like to show..

            "-p --port JMX port to connect to"
            "-T --timeout Timeout for each removal method invocation in milliseconds"

Like when you ask for help through the console.. 
Also I am using an Instance Strategy of jewelcli.. and in [1] there is a help request part, but not in [2]
And I would like to know if there is any function to print all the description without having to write it in the code..


Rocio

Tim Wood

unread,
Dec 1, 2015, 2:22:46 PM12/1/15
to jewe...@googlegroups.com

I think that you need to use this method:

http://jewelcli.lexicalscope.com/apidocs/com/lexicalscope/jewel/cli/Cli.html#getHelpMessage()

You can get the Cli instance from this class:

http://jewelcli.lexicalscope.com/apidocs/com/lexicalscope/jewel/cli/CliFactory.html

Does that answer the question?

Rocio Rama

unread,
Dec 2, 2015, 2:50:49 PM12/2/15
to jewelcli
It is what i need!
I had to create it first the Cli Instance and later getHelpMessage.
Thanks a lot!
Reply all
Reply to author
Forward
0 new messages