protected Options getGnuOptions()

in client/migrationx/migrationx-transformer/src/main/java/com/aliyun/dataworks/migrationx/transformer/core/translator/BeeLineCommandSqlTranslator.java [55:168]


    protected Options getGnuOptions() {
        Options options = new Options();

        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("driver class")
            .withDescription("The driver class to use")
            .create('d'));

        // -u <database url>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("database url")
            .withDescription("The JDBC URL to connect to")
            .create('u'));

        // -c <named url in the beeline-hs2-connection.xml>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("named JDBC URL in beeline-site.xml")
            .withDescription("The named JDBC URL to connect to, which should be present in "
                + "beeline-site.xml as the value of beeline.hs2.jdbc.url.<namedUrl>")
            .create('c'));

        // -r
        options.addOption(OptionBuilder
            .withLongOpt("reconnect")
            .withDescription("Reconnect to last saved connect url (in conjunction with !save)")
            .create('r'));

        // -n <username>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("username")
            .withDescription("The username to connect as")
            .create('n'));

        // -p <password>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("password")
            .withDescription("The password to connect as")
            .hasOptionalArg()
            .create('p'));

        // -w (or) --password-file <file>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("password-file")
            .withDescription("The password file to read password from")
            .withLongOpt("password-file")
            .create('w'));

        // -a <authType>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("authType")
            .withDescription("The authentication type")
            .create('a'));

        // -i <init file>
        options.addOption(OptionBuilder
            .hasArgs()
            .withArgName("init")
            .withDescription("The script file for initialization")
            .create('i'));

        // -e <query>
        options.addOption(OptionBuilder
            .hasArgs()
            .withArgName("query")
            .withDescription("The query that should be executed")
            .create('e'));

        // -f <script file>
        options.addOption(OptionBuilder
            .hasArg()
            .withArgName("file")
            .withDescription("The script file that should be executed")
            .create('f'));

        // -help
        options.addOption(OptionBuilder
            .withLongOpt("help")
            .withDescription("Display this message")
            .create('h'));

        // Substitution option --hivevar
        options.addOption(OptionBuilder
            .withValueSeparator()
            .hasArgs(2)
            .withArgName("key=value")
            .withLongOpt("hivevar")
            .withDescription("Hive variable name and value")
            .create());

        // hive conf option --hiveconf
        options.addOption(OptionBuilder
            .withValueSeparator()
            .hasArgs(2)
            .withArgName("property=value")
            .withLongOpt("hiveconf")
            .withDescription("Use value for given property")
            .create());

        // --property-file <file>
        options.addOption(OptionBuilder
            .hasArg()
            .withLongOpt("property-file")
            .withDescription("The file to read configuration properties from")
            .create());

        return options;
    }