@Test
public void generateManPage() throws IOException {

    @Command(name = "myapp", mixinStandardHelpOptions = true,
            version = {
                    "Versioned Command 1.0",
                    "Picocli " + picocli.CommandLine.VERSION,
                    "JVM: ${java.version} (${java.vendor} ${java.vm.name} ${java.vm.version})",
                    "OS: ${os.name} ${os.version} ${os.arch}"},
            description = "This app does great things.",
            exitCodeList = {
                    " 0:Successful program execution.",
                    "64:Invalid input: an unknown option or invalid parameter was specified.",
                    "70:Execution exception: an exception occurred while executing the business logic."},
            footerHeading = "Examples",
            footer = {
                    "This is the first line.",
                    "This is the second line.",
                    "This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very veryvery very very very very very very very very very very very very very very very long line."
            }
    )
    class MyApp {
        @Option(names = {"-o", "--output"}, description = "Output location full path.")
        File outputFolder;
        @Parameters(split = ",", description = "Some comma-separated values.")
        List<String> values;
    }
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw); //System.out, true
    ManPageGenerator.writeSingleManPage(pw, new CommandLine(new MyApp()).getCommandSpec());
    pw.flush();
    String expected = read("/myapp.manpage.adoc");
    expected = expected.replace("\r\n", "\n");
    expected = expected.replace("\n", System.getProperty("line.separator"));
    assertEquals(expected, sw.toString());
}