Gogo Shell should export 
-------------------------

                 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.

Reply via email to