示例#1
0
        /// <summary>
        /// Fills the available command buffer with the current available options.
        /// </summary>
        public static void UpdateCommandBuffer()
        {
            var references = DataHolder.GUIReferences;
            var data       = DataHolder.TerminalData;

            SList.Clear(data.AvailableCommands);

            var currentText = references.Input.value;

            var programName = CommandLineUtil.GetCommandName(currentText);
            var program     = Shell.FindProgramByCommand(programName);

            Action bufferFiller;

            if (program == null)
            {
                bufferFiller = null;
            }
            else
            {
                bufferFiller = Shell.GetProgramBufferFillerMethod(program);
            }

            if (bufferFiller == null)
            {
                FileSystem.FilleCommandBufferWithFileSystem(FillBufferFileSystemOptions.IncludeAll);
            }
            else
            {
                bufferFiller();
            }

            ChangeToAvailableCommandsBuffer();
        }
示例#2
0
 public static void FillCommandBuffer()
 {
     FileSystem.FilleCommandBufferWithFileSystem(FillBufferFileSystemOptions.IncludeDir);
     ProgramUtil.AddPrefixToCommandBuffer("cd ");
 }