@Override
    public void configure(Subparser subparser) {
        super.configure(subparser);

        subparser.addArgument("-n", "--dry-run")
                 .action(Arguments.storeTrue())
                 .dest("dry-run")
                 .setDefault(Boolean.FALSE)
                 .help("output the DDL to stdout, don't run it");

        subparser.addArgument("-c", "--count")
                 .type(Integer.class)
                 .dest("count")
                 .help("only apply the next N change sets");

        subparser.addArgument("-i", "--include")
                 .action(Arguments.append())
                 .dest("contexts")
                 .help("include change sets from the given context");
    }
@Test
    void testPrintHelp() throws Exception {
        final Subparser subparser = ArgumentParsers.newFor("db")
                .terminalWidthDetection(false)
                .build()
                .addSubparsers()
                .addParser(migrateCommand.getName())
                .description(migrateCommand.getDescription());
        migrateCommand.configure(subparser);

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        subparser.printHelp(new PrintWriter(new OutputStreamWriter(baos, UTF_8), true));
        assertThat(baos.toString(UTF_8.name())).isEqualToNormalizingNewlines(
                        "usage: db migrate [-h] [--migrations MIGRATIONS-FILE] [--catalog CATALOG]\n" +
                        "          [--schema SCHEMA] [-n] [-c COUNT] [-i CONTEXTS] [file]\n" +
                        "\n" +
                        "Apply all pending change sets.\n" +
                        "\n" +
                        "positional arguments:\n" +
                        "  file                   application configuration file\n" +
                        "\n" +
                        "named arguments:\n" +
                        "  -h, --help             show this help message and exit\n" +
                        "  --migrations MIGRATIONS-FILE\n" +
                        "                         the file containing  the  Liquibase migrations for\n" +
                        "                         the application\n" +
                        "  --catalog CATALOG      Specify  the   database   catalog   (use  database\n" +
                        "                         default if omitted)\n" +
                        "  --schema SCHEMA        Specify the database schema  (use database default\n" +
                        "                         if omitted)\n" +
                        "  -n, --dry-run          output the DDL to stdout, don't run it\n" +
                        "  -c COUNT, --count COUNT\n" +
                        "                         only apply the next N change sets\n" +
                        "  -i CONTEXTS, --include CONTEXTS\n" +
                        "                         include change sets from the given context\n");
    }