public void OptionRegistersParser() { const string value = "value"; _instanceUnderTest.Option("-o", cfg => cfg.Map.ToProperty(opt => opt.Value)); _instanceUnderTest.RuntimeCommand.MapArguments(NewParseContext("-o", value), _testOptions, ParserType.Option); _testOptions.Value.ShouldBe(value); }
private static void ConfigureCommand(CommandConfiguration <Models.BuildOptions> config) { config .Option <Models.Config>("-c|--config", opt => opt.Map.ToProperty(o => o.Configuration)) .Option <Models.Framework?>("--framework", opt => opt.Map.ToProperty(o => o.Framework)) .Option <Models.Runtime?>("-r|--runtime", opt => opt.Map.ToProperty(o => o.Runtime)) .Option <Models.Verbosity>("-v|--verbosity", opt => opt.Map.ToProperty(o => o.Verbosity)) .Switch("-f|--force", opt => opt.Map.ToProperty(o => o.Force)) .Switch("-d|--no-dependencies", opt => opt.Map.ToProperty(o => o.NoDependencies)) .Switch("-x|--no-restore", opt => opt.Map.ToProperty(o => o.NoRestore)) .Option("--output", opt => opt.Map.ToProperty(o => o.Output)) .Option("--version-suffix", opt => opt.Map.ToProperty(o => o.VersionSuffix)); }