コード例 #1
0
        internal static IEnumerable <string> ResolveOsOptionToRuntimeIdentifier(string arg, ParseResult parseResult)
        {
            if (parseResult.HasOption(RuntimeOption(string.Empty).Aliases.First()))
            {
                throw new GracefulException(CommonLocalizableStrings.CannotSpecifyBothRuntimeAndOsOptions);
            }

            var selfContainedSpecified = parseResult.HasOption(SelfContainedOption().Aliases.First()) || parseResult.HasOption(NoSelfContainedOption().Aliases.First());

            if (parseResult.BothArchAndOsOptionsSpecified())
            {
                return(ResolveRidShorthandOptions(arg, parseResult.ValueForOption <string>(CommonOptions.ArchitectureOption().Aliases.First()), selfContainedSpecified));
            }

            return(ResolveRidShorthandOptions(arg, null, selfContainedSpecified));
        }
コード例 #2
0
        internal static IEnumerable <string> ResolveOsOptionToRuntimeIdentifier(string arg, ParseResult parseResult)
        {
            if (parseResult.HasOption(RuntimeOption) || parseResult.HasOption(LongFormRuntimeOption))
            {
                throw new GracefulException(CommonLocalizableStrings.CannotSpecifyBothRuntimeAndOsOptions);
            }

            var selfContainedSpecified = parseResult.HasOption(SelfContainedOption) || parseResult.HasOption(NoSelfContainedOption);

            if (parseResult.BothArchAndOsOptionsSpecified())
            {
                return(ResolveRidShorthandOptions(arg, ArchOptionValue(parseResult), selfContainedSpecified));
            }

            return(ResolveRidShorthandOptions(arg, null, selfContainedSpecified));
        }
コード例 #3
0
        internal static IEnumerable <string> ResolveArchOptionToRuntimeIdentifier(string arg, ParseResult parseResult)
        {
            if (parseResult.HasOption(RuntimeOption(string.Empty).Aliases.First()))
            {
                throw new GracefulException(CommonLocalizableStrings.CannotSpecifyBothRuntimeAndArchOptions);
            }

            if (parseResult.BothArchAndOsOptionsSpecified())
            {
                // ResolveOsOptionToRuntimeIdentifier handles resolving the RID when both arch and os are specified
                return(Array.Empty <string>());
            }

            var selfContainedSpecified = parseResult.HasOption(SelfContainedOption().Aliases.First()) || parseResult.HasOption(NoSelfContainedOption().Aliases.First());

            return(ResolveRidShorthandOptions(null, arg, selfContainedSpecified));
        }