﻿namespace Moya.Runner.Console
{
    public struct OptionArgumentPair
    {
        public string Option { get; set; }

        public string Argument { get; set; }

        public static OptionArgumentPair Create(string stringFromCommandLine)
        {
            string[] optionAndArgument = stringFromCommandLine.Split('=');
            return new OptionArgumentPair
            {
                Option = optionAndArgument[0],
                Argument = optionAndArgument[1]
            };
        }
    }
}
﻿namespace Moya.Runner.Console
{
    using System.Linq;

    public struct OptionArgumentPair
    {
        public string Option { get; set; }

        public string Argument { get; set; }

        public static OptionArgumentPair Create(string stringFromCommandLine)
        {
            string[] optionAndArgument = stringFromCommandLine.Split('=');

            return new OptionArgumentPair
            {
                Option = optionAndArgument.Any() ? optionAndArgument[0] : string.Empty,
                Argument = optionAndArgument.Count() > 1 ? optionAndArgument[1] : string.Empty
            };
        }
    }
}
Handle optionargumentpairs with only option
Handle optionargumentpairs with only option
