You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2010/08/11 15:45:16 UTC

[jira] Commented: (FELIX-2536) Gogo Shell should export org.apache.felix.gogo.options package

    [ https://issues.apache.org/jira/browse/FELIX-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897267#action_12897267 ] 

Richard S. Hall commented on FELIX-2536:
----------------------------------------

I don't think something like this will become part of the spec. We are free to include it, but it would tie such commands to our shell impl. It appears that the RFC is going to include annotations similar to the ones introduced in Gogo when I created the commands in the the "command" Gogo sub-module.

> Gogo Shell should export org.apache.felix.gogo.options package
> --------------------------------------------------------------
>
>                 Key: FELIX-2536
>                 URL: https://issues.apache.org/jira/browse/FELIX-2536
>             Project: Felix
>          Issue Type: Improvement
>          Components: Gogo Shell
>            Reporter: David Savage
>            Priority: Minor
>             Fix For: gogo-0.8.0
>
>
> The Gogo shell bundle includes a helpful utility class to handle Options parsing in the gogo environment.
> org.apache.felix.gogo.options.Options
> final String[] usage = {
>             "test - test Options usage",
>             "  text before Usage: is displayed when usage() is called and no error has occurred.",
>             "  so can be used as a simple help message.",
>             "",
>             "Usage: testOptions [OPTION]... PATTERN [FILES]...",
>             "  Output control: arbitary non-option text can be included.",
>             "  -? --help                show help",
>             "  -c --count=COUNT           show COUNT lines",
>             "  -h --no-filename         suppress the prefixing filename on output",
>             "  -q --quiet, --silent     suppress all normal output",
>             "     --binary-files=TYPE   assume that binary files are TYPE",
>             "                           TYPE is 'binary', 'text', or 'without-match'",
>             "  -I                       equivalent to --binary-files=without-match",
>             "  -d --directories=ACTION  how to handle directories (default=skip)",
>             "                           ACTION is 'read', 'recurse', or 'skip'",
>             "  -D --devices=ACTION      how to handle devices, FIFOs and sockets",
>             "                           ACTION is 'read' or 'skip'",
>             "  -R, -r --recursive       equivalent to --directories=recurse" };
>         Option opt = Options.compile(usage).parse(args);
>         if (opt.isSet("help")) {
>             opt.usage(); // includes text before Usage:
>             return;
>         }
>         if (opt.args().size() == 0)
>             throw opt.usageError("PATTERN not specified");
>         System.out.println(opt);
>         if (opt.isSet("count"))
>             System.out.println("count = " + opt.getNumber("count"));
>         System.out.println("--directories specified: " + opt.isSet("directories"));
>         System.out.println("directories=" + opt.get("directories"));
> However the package containing this class is not exported from this bundle so it cannot be used by client code

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.