Пример #1
0
        public void AddToTargetTreeTest()
        {
            TargetTree targetTree = _provider.GetService <TargetTree>();

            targetTree.AddTarget("test.target");

            Assert.True(targetTree.HasAllTargets(new List <string>()
            {
                "test.target"
            }, out _));
        }
Пример #2
0
        private static (List <string> targetsToRun, bool unknownTarget, List <string> notFoundTargets) ParseCmdLineArgs(ITaskContextInternal context, TargetTree targetTree)
        {
            if (context.Args.MainCommands == null || context.Args.MainCommands.Count == 0)
            {
                return(null, false, null);
            }

            if (targetTree.HasAllTargets(context.Args.MainCommands, out var notFoundTargets))
            {
                return(context.Args.MainCommands, false, null);
            }

            return(new List <string> {
                "help"
            }, true, notFoundTargets);
        }
Пример #3
0
        public static (List <string> targetsToRun, bool unknownTarget, List <string> notFoundTargets) ParseCmdLineArgs(List <string> mainCommands, TargetTree targetTree)
        {
            if (mainCommands == null || mainCommands.Count == 0)
            {
                return(null, false, null);
            }

            if (targetTree.HasAllTargets(mainCommands, out var notFoundTargets))
            {
                return(mainCommands, false, null);
            }

            return(new List <string> {
                FlubuTargets.Help
            }, true, notFoundTargets);
        }