Throw an error if anything is left over and should not be.
| 6661 | |
| 6662 | /// Throw an error if anything is left over and should not be. |
| 6663 | void _process_extras() { |
| 6664 | if (!(allow_extras_ || prefix_command_)) { |
| 6665 | std::size_t num_left_over = remaining_size(); |
| 6666 | if (num_left_over > 0) { |
| 6667 | throw ExtrasError(name_, remaining(false)); |
| 6668 | } |
| 6669 | } |
| 6670 | |
| 6671 | for (App_p &sub : subcommands_) { |
| 6672 | if (sub->count() > 0) sub->_process_extras(); |
| 6673 | } |
| 6674 | } |
| 6675 | |
| 6676 | /// Throw an error if anything is left over and should not be. |
| 6677 | /// Modifies the args to fill in the missing items before throwing. |
nothing calls this directly
no test coverage detected