コード例 #1
0
 public AConsoleCommand GetCommand(ConsoleInstance console)
 {
     if (Name.Parsed != null)
     {
         return(console.FindCommand(Name.Parsed as string));
     }
     else
     {
         return(console.FindCommand(Name.Value));
     }
 }
コード例 #2
0
        public AHintIterator GetHintIterator(string input, int cursor, List <ConsoleException> issues = null)
        {
            List <Query> queries;

            try
            {
                queries = m_Console.ParseQuery(input);
            }
            catch (ConsoleException e)
            {
                queries = new List <Query>();
                issues.Add(e);
            }

            Query           query    = null;
            Argument        argument = null;
            AConsoleCommand command  = null;

            FindQueryAndArgument(queries, cursor, out query, out argument);

            if (query != null)
            {
                command = m_Console.FindCommand(query.Name.Value);
                MapAndParseQuery(command, query, issues);
            }

            AHint hint = GetHint(command, query, argument);

            if (hint != null)
            {
                if (argument == null)
                {
                    argument = new Argument(true);
                }
                return(hint.GetIterator(query, argument));
            }

            return(null);
        }