public void AssertSafeToSwitchProcessingContext() { if (!ProcessingOrderedOptions || AllOrderedOptionsProcessed) { ProcessedClusteredOptions = null; NextArgumentIsForClusteredOptions = false; return; } logger.LogDebug("Not all ordered options where processed before switching to a new context. The current context is '{ctx}' with {amount} of options left unprocessed", CurrentCommand.ToString(), orderedOptions.Count); foreach (var unprocessedOption in orderedOptions) { logger.LogDebug("{Option} was unprocessed", unprocessedOption); } throw new InvalidOperationException("Not all ordered options where processed before switching to another option/command context!"); }