private static CommandLine parse(
            final List<String> originalArgs,
            final Options options,
            final String usage,
            final String header,
            final CommandWriters writers,
            final Logger logger) {
        final DefaultParser parser = new DefaultParser();
        try {
            final CommandLine commandLine = parser.parse(options, originalArgs.toArray(new String[0]), false);
            if (commandLine.hasOption(RUBY.getOpt())) {
                logger.warn("The command line option \"-R\" is deprecated. "
                            + "Set an Embulk system property \"jruby_command_line_options\" instead. "
                            + "\"-X jruby_command_line_options=--dev\", for example.");
            }
            return commandLine;
        } catch (final ParseException ex) {
            writers.printlnErr("embulk: " + ex.getMessage());
            logger.debug(ex.getMessage(), ex);
            printHelp(options, usage, header, writers.getStdOutWriter());
            return null;
        }
    }
Creates a CommandLineImpl instance for "gem" and "bundle" which pass-thorugh following arguments.
embulk-deps/src/main/java/org/embulk/deps/cli/CommandLineImpl.java