private void accumulatePositionalArg(ParseState state, ArgumentImpl arg)
            throws ArgumentParserException {
        if (!arg.getAction().consumeArgument()) {
            // This positional argument does not consume argument (is it
            // useful?)
            ++state.posargIndex;
            return;
        }
        if (arg.getMinNumArg() == -1
                || (arg.getMinNumArg() == 0 && arg.getMaxNumArg() == 1)) {
            // In case of: option takes exactly one argument, or nargs("?")
            state.posargArgs.add(state.getArg());
            ++state.index;
            ++state.posargIndex;
            return;
        }
        for (; state.posargConsumed < arg.getMaxNumArg() && state.isArgAvail(); ++state.posargConsumed, ++state.index) {
            if (flagFound(state)) {
                break;
            }
            state.posargArgs.add(state.getArg());
        }
        if (state.posargConsumed == arg.getMaxNumArg()) {
            // all possible parameters are consumed for this positional
            // argument. Process next one.
            ++state.posargIndex;
            state.posargConsumed = 0;
            return;
        }
    }