public static void main(String[] args) throws Exception {
        TikaCLI cli = new TikaCLI();

        if (cli.testForHelp(args)) {
            cli.usage();
            return;
        } else if (cli.testForBatch(args)) {
            String[] batchArgs = BatchCommandLineBuilder.build(args);
            BatchProcessDriverCLI batchDriver = new BatchProcessDriverCLI(batchArgs);
            batchDriver.execute();
            return;
        } else if (cli.testForAsync(args)) {
            async(args);
            return;
        }

        if (args.length > 0) {
            for (String arg : args) {
                cli.process(arg);
            }
            if (cli.pipeMode) {
                cli.process("-");
            }
        } else {
            // Started with no arguments. Wait for up to 0.1s to see if
            // we have something waiting in standard input and use the
            // pipe mode if we have. If no input is seen, start the GUI.
            if (System.in.available() == 0) {
                Thread.sleep(100);
            }
            if (System.in.available() > 0) {
                cli.process("-");
            } else {
                cli.process("--gui");
            }
        }
    }
@Test
    public void testExtractInlineImages() throws Exception {
        String[] params = {"--extract-dir=" + extractDir.toAbsolutePath(), "-z", resourcePrefix + "/testPDF_childAttachments.pdf"};

        TikaCLI.main(params);

        String[] tempFileNames = extractDir
                .toFile()
                .list();
        assertNotNull(tempFileNames);
        String allFiles = String.join(" : ", tempFileNames);

        Path jpeg = extractDir.resolve("image0.jpg");
        //tiff isn't extracted without optional image dependency
//            File tiff = new File(tempFile, "image1.tif");
        Path jobOptions = extractDir.resolve("Press Quality(1).joboptions");
        Path doc = extractDir.resolve("Unit10.doc");

        assertExtracted(jpeg, allFiles);
        assertExtracted(jobOptions, allFiles);
        assertExtracted(doc, allFiles);
    }