Exemplo n.º 1
0
        private static void ValidateRequiredParameters(CommandTree tree)
        {
            var node = tree.GetRootCommand();

            while (node != null)
            {
                foreach (var parameter in node.Unmapped)
                {
                    if (parameter.Required)
                    {
                        switch (parameter)
                        {
                        case CommandArgument argument:
                            throw RuntimeException.MissingRequiredArgument(node, argument);
                        }
                    }
                }
                node = node.Next;
            }
        }