Package net.sourceforge.argparse4j.inf

Examples of net.sourceforge.argparse4j.inf.ArgumentParser.addArgument()


    public static void main(String[] args) {
        ArgumentParser parser = ArgumentParsers.newArgumentParser("hurl")
            .description("Like curl, for hmac-protected resources")
            .defaultHelp(true);

        parser.addArgument("-X", "--request").help("GET (default), POST, PUT, or DELETE").type(String.class).choices("GET", "POST", "PUT", "DELETE").setDefault("GET");
        parser.addArgument("--apiKey").required(true);
        parser.addArgument("--secretKey").required(true);
        parser.addArgument("-v", "--verbose").action(storeTrue()).help("Prints additional information to stderr");
        parser.addArgument("--data", "--data-binary").required(false).help("The data to use in a POST (or @filename for a file full of data)");
View Full Code Here


        ArgumentParser parser = ArgumentParsers.newArgumentParser("hurl")
            .description("Like curl, for hmac-protected resources")
            .defaultHelp(true);

        parser.addArgument("-X", "--request").help("GET (default), POST, PUT, or DELETE").type(String.class).choices("GET", "POST", "PUT", "DELETE").setDefault("GET");
        parser.addArgument("--apiKey").required(true);
        parser.addArgument("--secretKey").required(true);
        parser.addArgument("-v", "--verbose").action(storeTrue()).help("Prints additional information to stderr");
        parser.addArgument("--data", "--data-binary").required(false).help("The data to use in a POST (or @filename for a file full of data)");

        MutuallyExclusiveGroup contentTypes = parser.addMutuallyExclusiveGroup();
View Full Code Here

            .description("Like curl, for hmac-protected resources")
            .defaultHelp(true);

        parser.addArgument("-X", "--request").help("GET (default), POST, PUT, or DELETE").type(String.class).choices("GET", "POST", "PUT", "DELETE").setDefault("GET");
        parser.addArgument("--apiKey").required(true);
        parser.addArgument("--secretKey").required(true);
        parser.addArgument("-v", "--verbose").action(storeTrue()).help("Prints additional information to stderr");
        parser.addArgument("--data", "--data-binary").required(false).help("The data to use in a POST (or @filename for a file full of data)");

        MutuallyExclusiveGroup contentTypes = parser.addMutuallyExclusiveGroup();
        contentTypes.addArgument("-C", "--content-type").help("Content type to send in the Content-Type request header");
View Full Code Here

            .defaultHelp(true);

        parser.addArgument("-X", "--request").help("GET (default), POST, PUT, or DELETE").type(String.class).choices("GET", "POST", "PUT", "DELETE").setDefault("GET");
        parser.addArgument("--apiKey").required(true);
        parser.addArgument("--secretKey").required(true);
        parser.addArgument("-v", "--verbose").action(storeTrue()).help("Prints additional information to stderr");
        parser.addArgument("--data", "--data-binary").required(false).help("The data to use in a POST (or @filename for a file full of data)");

        MutuallyExclusiveGroup contentTypes = parser.addMutuallyExclusiveGroup();
        contentTypes.addArgument("-C", "--content-type").help("Content type to send in the Content-Type request header");
        contentTypes.addArgument("-J", "--json").dest("content_type").setConst("application/json").action(storeConst()).help("Specifies application/json in the Content-Type request header");
View Full Code Here

        parser.addArgument("-X", "--request").help("GET (default), POST, PUT, or DELETE").type(String.class).choices("GET", "POST", "PUT", "DELETE").setDefault("GET");
        parser.addArgument("--apiKey").required(true);
        parser.addArgument("--secretKey").required(true);
        parser.addArgument("-v", "--verbose").action(storeTrue()).help("Prints additional information to stderr");
        parser.addArgument("--data", "--data-binary").required(false).help("The data to use in a POST (or @filename for a file full of data)");

        MutuallyExclusiveGroup contentTypes = parser.addMutuallyExclusiveGroup();
        contentTypes.addArgument("-C", "--content-type").help("Content type to send in the Content-Type request header");
        contentTypes.addArgument("-J", "--json").dest("content_type").setConst("application/json").action(storeConst()).help("Specifies application/json in the Content-Type request header");
View Full Code Here

        MutuallyExclusiveGroup contentTypes = parser.addMutuallyExclusiveGroup();
        contentTypes.addArgument("-C", "--content-type").help("Content type to send in the Content-Type request header");
        contentTypes.addArgument("-J", "--json").dest("content_type").setConst("application/json").action(storeConst()).help("Specifies application/json in the Content-Type request header");

        parser.addArgument("url").required(true);

        try {
            Namespace ns = parser.parseArgs(args);
            String method = ns.getString("request");
            String url = ns.getString("url");
View Full Code Here

    }

    private static Namespace parseCommandLine(String[] args) throws ArgumentParserException {
        String usage = "java -jar " + new JarLocation(CalculatorProxyUser.class);
        ArgumentParser argParser = ArgumentParsers.newArgumentParser(usage).defaultHelp(true);
        argParser.addArgument("config-file").nargs("?").help("yaml configuration file");
        return argParser.parseArgs(args);
    }

    private static CalculatorConfiguration loadConfigFile(String configFile)
            throws IOException, ConfigurationException {
View Full Code Here

    }

    private static Namespace parseCommandLine(String[] args) throws ArgumentParserException {
        String usage = "java -jar " + new JarLocation(CalculatorUser.class);
        ArgumentParser argParser = ArgumentParsers.newArgumentParser(usage).defaultHelp(true);
        argParser.addArgument("config-file").nargs("?").help("yaml configuration file");
        return argParser.parseArgs(args);
    }

    private static CalculatorConfiguration loadConfigFile(String configFile)
            throws IOException, ConfigurationException {
View Full Code Here

    }

    private static Namespace parseCommandLine(String[] args) throws ArgumentParserException {
        String usage = "java -jar " + new JarLocation(CalculatorProxyUser.class);
        ArgumentParser argParser = ArgumentParsers.newArgumentParser(usage).defaultHelp(true);
        argParser.addArgument("config-file").nargs("?").help("yaml configuration file");
        return argParser.parseArgs(args);
    }

    private static CalculatorConfiguration loadConfigFile(String configFile)
            throws IOException, ConfigurationException {
View Full Code Here

    }

    private static Namespace parseCommandLine(String[] args) throws ArgumentParserException {
        String usage = "java -jar " + new JarLocation(CalculatorUser.class);
        ArgumentParser argParser = ArgumentParsers.newArgumentParser(usage).defaultHelp(true);
        argParser.addArgument("config-file").nargs("?").help("yaml configuration file");
        return argParser.parseArgs(args);
    }

    private static CalculatorConfiguration loadConfigFile(String configFile)
            throws IOException, ConfigurationException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.