@Override
    public int apply(Arguments arguments, Command.Env env) {
        // Force parsing to finish.
        List<String> positionalArguments = arguments.getPositional();

        if (arguments.getReceiver(StandardOptions.class).help()) {
            printHelp(arguments, env.colors(), env.stdout());
            return 0;
        }

        LOGGER.fine(() -> "Invoking Command with positional arguments: " + positionalArguments);
        return delegate.apply(arguments, env);
    }
A {@code CommandAction} that intercepts another action and handles printing -h / --help.
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/HelpActionWrapper.java