コード例 #1
0
ファイル: Program.cs プロジェクト: vitek-karas/sdk
        public static CleanCommand FromParseResult(ParseResult result, string msbuildPath = null)
        {
            var msbuildArgs = new List <string>
            {
                "-verbosity:normal"
            };

            result.ShowHelpOrErrorIfAppropriate();

            msbuildArgs.AddRange(result.GetValueForArgument(CleanCommandParser.SlnOrProjectArgument) ?? Array.Empty <string>());

            msbuildArgs.Add("-target:Clean");

            msbuildArgs.AddRange(result.OptionValuesToBeForwarded(CleanCommandParser.GetCommand()));

            return(new CleanCommand(msbuildArgs, msbuildPath));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: viniqsoares/sdk
        public static CleanCommand FromArgs(string[] args, string msbuildPath = null)
        {
            var msbuildArgs = new List <string>
            {
                "-verbosity:normal"
            };

            var parser = Parser.Instance;

            var result = parser.ParseFrom("dotnet clean", args);

            result.ShowHelpOrErrorIfAppropriate();

            msbuildArgs.AddRange(result.ValueForArgument <IEnumerable <string> >(CleanCommandParser.SlnOrProjectArgument) ?? Array.Empty <string>());

            msbuildArgs.Add("-target:Clean");

            msbuildArgs.AddRange(result.OptionValuesToBeForwarded(CleanCommandParser.GetCommand()));

            return(new CleanCommand(msbuildArgs, msbuildPath));
        }