/// <summary>
        /// Builds a <see cref="CommandTree"/>-object by searching through the provided Assembly.
        /// Will not fill Options and Arguments of <see cref="Command"/>-objects since those are only needed for the commands a user wants to execute.
        /// </summary>
        /// <returns></returns>
        public CommandTree BuildBaseTree()
        {
            _commandTree = new CommandTree();

            // Could call FillCommands for each CommandGroup from within FillCommandGroups()
            // but I don't like chaining calls in that way. It is easier to understand
            // what happens here if both get called from this function.
            FillCommandGroups();
            FillCommands();

            return(_commandTree);
        }
Esempio n. 2
0
 public static CommandMatch FindCommand(this CommandTree commandTree, ParsedInput input)
 {
     return(commandTree.FindCommand(input.Command, input.Options.Keys.ToList(), input.Arguments.Keys.ToList()));
 }