private bool ParseArguments()
        {
            ProjectPath = Options.ProjectArgument.Value;
            if (string.IsNullOrEmpty(ProjectPath))
            {
                Application.Error.WriteLine("Project path not specified.");
                return(false);
            }

            if (!OutputPathOption.HasValue())
            {
                Application.Error.WriteLine($"Option {OutputPathTemplate} does not specify a value.");
                return(false);
            }

            if (!ApplicationNameOption.HasValue())
            {
                Application.Error.WriteLine($"Option {ApplicationNameTemplate} does not specify a value.");
                return(false);
            }

            if (!Options.ContentRootOption.HasValue())
            {
                Application.Error.WriteLine($"Option {CommonOptions.ContentRootTemplate} does not specify a value.");
                return(false);
            }

            return(true);
        }
示例#2
0
        private void ParseArguments()
        {
            ProjectPath   = GetProjectPath();
            Configuration = ConfigurationOption.Value() ?? DotNet.Cli.Utils.Constants.DefaultConfiguration;

            if (!FrameworkOption.HasValue())
            {
                throw new Exception($"Option {FrameworkOption.Template} does not have a value.");
            }
            TargetFramework = NuGetFramework.Parse(FrameworkOption.Value());

            if (!OutputPathOption.HasValue())
            {
                throw new Exception($"Option {OutputPathOption.Template} does not have a value.");
            }
            OutputPath = OutputPathOption.Value();
        }
示例#3
0
        private void ParseArguments()
        {
            ProjectPath = Options.ProjectArgument.Value;
            if (string.IsNullOrEmpty(ProjectPath))
            {
                throw new ArgumentException("Project path not specified.");
            }

            if (!OutputPathOption.HasValue())
            {
                throw new ArgumentException($"Option {OutputPathTemplate} does not specify a value.");
            }

            if (!ApplicationNameOption.HasValue())
            {
                throw new ArgumentException($"Option {ApplicationNameTemplate} does not specify a value.");
            }
        }
        private bool ParseArguments()
        {
            ProjectPath   = GetProjectPath(Options.ProjectArgument.Value);
            Configuration = ConfigurationOption.Value() ?? DotNet.Cli.Utils.Constants.DefaultConfiguration;

            if (FrameworkOption.HasValue())
            {
                TargetFramework = NuGetFramework.Parse(FrameworkOption.Value());
            }

            if (!OutputPathOption.HasValue())
            {
                Application.Error.WriteLine($"Option {OutputPathOption.Template} does not have a value.");
                return(false);
            }
            OutputPath = OutputPathOption.Value();

            return(true);
        }