private string GetDefaultValueForContainer(IContainerCommand containerCommand, string promptText)
        {
            var defaultValue = containerCommand.GetDefaultCommandSelector(Processor.ActiveContext);

            if (!string.IsNullOrWhiteSpace(defaultValue))
            {
                return($"{promptText} [{defaultValue}]");
            }

            return(promptText);
        }
Exemple #2
0
        private void ProcessIncludedFiles(Command command)
        {
            if (command is IContainerCommand)
            {
                IContainerCommand iContainer = (IContainerCommand)command;
                if (iContainer.InnerCommands == null)
                {
                    return;
                }
                foreach (Command cmd in iContainer.InnerCommands)
                {
                    ProcessIncludedFiles(cmd);
                }
            }

            if (command is IContentCommand)
            {
                IContentCommand cntCommand     = (IContentCommand)command;
                string          sourceFilePath = cntCommand.ContentPath;
                if (sourceFilePath == null)
                {
                    return;
                }
                if (sourceFilePath.Contains(ExecutionContext.PACKAGE_CONTENT_TAG) ||
                    sourceFilePath.Contains(ExecutionContext.GIN_EXE_TAG))
                {
                    return;
                }
                cntCommand.ContentPath = _content.AddContent(sourceFilePath);
            }
            if (command is IMultipleContentCommand)
            {
                IMultipleContentCommand cntCommand = (IMultipleContentCommand)command;
                if (cntCommand.ContentPaths != null)
                {
                    foreach (ContentPath p in cntCommand.ContentPaths)
                    {
                        string sourceFilePath = p.Value;
                        if (sourceFilePath == null)
                        {
                            return;
                        }
                        if (sourceFilePath.Contains(ExecutionContext.PACKAGE_CONTENT_TAG) ||
                            sourceFilePath.Contains(ExecutionContext.GIN_EXE_TAG))
                        {
                            return;
                        }
                        p.Value = _content.AddContent(sourceFilePath);
                    }
                }
            }
        }
        private string GetCommandOptionsForContainer(IContainerCommand containerCommand, string promptText)
        {
            var subCommands = string.Join(",", containerCommand.Children.Select(x => x.PrimarySelector));

            return($"{promptText}: {containerCommand.Name} ({subCommands})");
        }