Skip to content

Commit 4c2a115

Browse files
committed
Merge branch 'master' into develop
2 parents e80b4dc + 24e2be2 commit 4c2a115

File tree

6 files changed

+67
-51
lines changed

6 files changed

+67
-51
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ All notable changes to this project will be documented in this file.
33

44
CommandLineParser project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## [2.8.0-preview1] - 2020-3-12
6+
## [2.8.0] - 2020-5-1
7+
## [2.8.0-preview4] - 2020-4-30
8+
## [2.8.0-preview1] - 2020-3-14
79

810
### Added
911
- Added support for async programming for `WithParsed and WithNotParsed` by [@joseangelmt, PR# 390 ](https://github.com/commandlineparser/commandline/pull/390).
12+
- Publish a new symbol packages with source link support for c# and F# (.snupkg) to improved package debugging experience by [@moh-hassan, PR#554](https://github.com/commandlineparser/commandline/pull/554)
1013
- Add default verb support by [@Artentus, PR# 556](https://github.com/commandlineparser/commandline/pull/556).
1114
- Add more details for localized attribute properties by [@EdmondShtogu, PR# 558](https://github.com/commandlineparser/commandline/pull/558)
1215
- Support Default in Group Options and raise error if both SetName and Group are applied on option by [@hadzhiyski, PR# 575](https://github.com/commandlineparser/commandline/pull/575).
13-
- Support mutable types without empty constructor that only does explicit implementation of interfaces by [@pergardebrink](https://github.com/commandlineparser/commandline/pull/590).
16+
- Support mutable types without empty constructor that only does explicit implementation of interfaces by [@pergardebrink, PR#590](https://github.com/commandlineparser/commandline/pull/590).
17+
1418

1519
### Changed
1620
- Tests cleanup by [@gsscoder, PR# 560](https://github.com/commandlineparser/commandline/pull/560).
@@ -19,6 +23,7 @@ CommandLineParser project adheres to [Semantic Versioning](https://semver.org/sp
1923
- SkipDefault is being respected by [Usage] Examples by [@kendfrey, PR# 565](https://github.com/commandlineparser/commandline/pull/565).
2024
- Remove useless testing code by [@gsscoder, PR# 568](https://github.com/commandlineparser/commandline/pull/568).
2125
- Remove constraint on T for ParseArguments with factory (required by issue #70) by [@pergardebrink](https://github.com/commandlineparser/commandline/pull/590).
26+
- Update nuget api key by [@ericnewton76](https://github.com/commandlineparser/commandline/commit/2218294550e94bcbc2b76783970541385eaf9c07)
2227

2328
### Fixed
2429
- Fix #579 Unable to parse TimeSpan given from the FormatCommandLine by [@gsscoder, PR# 580](https://github.com/commandlineparser/commandline/pull/580).

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ The Command Line Parser Library offers CLR applications a clean and concise API
1414
C:\Project> NuGet Install CommandLineParser
1515
```
1616

17+
# Nightly Build
18+
19+
Nightly version of the CommandLineParser can be downloaded from github [Releases](https://github.com/commandlineparser/commandline/releases).
20+
21+
The Last new features and fixes, read [changelog](https://github.com/commandlineparser/commandline/blob/master/CHANGELOG.md)
22+
23+
1724
_NOTE: Mentioned F# Support is provided via ```CommandLineParser.FSharp``` package with FSharp dependencies._
1825

1926
__This library provides _hassle free_ command line parsing with a constantly updated API since 2005.__

appveyor.yml

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#version should be only changed with RELEASE eminent, see RELEASE.md
22

33
version: 2.8.0-ci-{build}
4-
image:
5-
- Visual Studio 2019
6-
- ubuntu1804
4+
5+
image: Visual Studio 2019
76

87
clone_depth: 1
98
pull_requests:
10-
do_not_increment_build_number: false
9+
do_not_increment_build_number: true
1110

1211
init:
1312
- ps: |
@@ -16,69 +15,47 @@ init:
1615
if ($env:APPVEYOR_REPO_TAG -eq "true") {
1716
$ver = $env:APPVEYOR_REPO_TAG_NAME
1817
if($ver.StartsWith("v") -eq $true) { $ver = $ver.Substring(1) }
19-
$env:PACKAGE_VERSION = $ver
20-
} else {
21-
$env:PACKAGE_VERSION = $env:APPVEYOR_BUILD_VERSION
18+
Update-AppveyorBuild -Version $ver
2219
}
23-
- ps: |
24-
Write-Host "PACKAGE_VERSION:$env:PACKAGE_VERSION | APPVEYOR_BUILD_VERSION='$env:APPVEYOR_BUILD_VERSION'" -ForegroundColor Yellow
25-
Write-Host "APPVEYOR_REPO_TAG_NAME:$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Yellow
26-
27-
skip_commits:
28-
files:
29-
- docs/*
30-
- art/*
31-
- '**/*.md'
32-
- .gitignore
33-
- .editorconfig
34-
message: /updated readme.*|update readme.*s|update docs.*|update version.*|update changelog.*/
3520
3621
environment:
3722
matrix:
3823
- BUILD_TARGET: base
3924
- BUILD_TARGET: fsharp
4025

4126
build_script:
42-
- cmd: dotnet build src/CommandLine/ -c Release --version-suffix %PACKAGE_VERSION% /p:BuildTarget=%BUILD_TARGET%
43-
- sh: dotnet build src/CommandLine/ -c Release --version-suffix $PACKAGE_VERSION /p:BuildTarget=$BUILD_TARGET
27+
- cmd: dotnet build src/CommandLine/ -c Release --version-suffix %APPVEYOR_BUILD_VERSION% /p:BuildTarget=%BUILD_TARGET%
4428

4529
test_script:
4630
- cmd: dotnet test tests/CommandLine.Tests/ /p:BuildTarget=%BUILD_TARGET%
47-
- sh: dotnet test tests/CommandLine.Tests/ /p:BuildTarget=$BUILD_TARGET -f netcoreapp2.0
4831

4932
after_test:
50-
- cmd: dotnet pack src/CommandLine/ -c Release --version-suffix %PACKAGE_VERSION% /p:BuildTarget=%BUILD_TARGET%
51-
- sh: dotnet pack src/CommandLine/ -c Release --version-suffix $PACKAGE_VERSION /p:BuildTarget=$BUILD_TARGET
33+
- cmd: dotnet pack src/CommandLine/ -c Release --version-suffix %APPVEYOR_BUILD_VERSION% /p:BuildTarget=%BUILD_TARGET%
5234

5335
artifacts:
5436
- path: 'src/CommandLine/bin/Release/*.nupkg'
5537
name: NuGetPackages
5638
- path: 'src/CommandLine/bin/Release/*.snupkg'
57-
name: symbol
39+
name: symbol
40+
5841
on_failure:
5942
- cmd: |
6043
tree /f /a >files.lst
6144
appveyor PushArtifact .\files.lst -DeploymentName "Failed Build File Listing"
6245
63-
for:
64-
-
65-
matrix:
66-
only:
67-
- image: Visual Studio 2019
68-
deploy:
69-
- provider: GitHub
70-
auth_token:
71-
secure: hVyVwHl0JiVq0VxXB4VMRWbUtrGclIzadfnWFcWCQBLvbgMLahLBnWlwGglT63pZ
72-
artifact: 'NuGetPackages'
73-
prerelease: false
74-
force_update: true #fsharp package runs as separate build job, so have to force_update to add fsharp.nuget added
75-
on:
76-
APPVEYOR_REPO_TAG: true
77-
78-
- provider: NuGet
79-
api_key:
80-
secure: Ab4T/48EyIJhVrqkfKdUxmHUtseEVuXuyrGACxZ0KN35rb/BzABlBM2YjZojicvT
81-
artifact: 'NuGetPackages'
82-
on:
83-
APPVEYOR_REPO_TAG: true
84-
46+
deploy:
47+
- provider: GitHub
48+
auth_token:
49+
secure: hVyVwHl0JiVq0VxXB4VMRWbUtrGclIzadfnWFcWCQBLvbgMLahLBnWlwGglT63pZ
50+
artifact: /.*(\.|\.s)nupkg/
51+
prerelease: false
52+
force_update: true #fsharp package runs as separate build job, so have to force_update to add fsharp.nuget added
53+
on:
54+
APPVEYOR_REPO_TAG: true
55+
56+
- provider: NuGet
57+
api_key:
58+
secure: e2gJJ3r6Uls5trJwryaudAZd49QniNfIjax/A+tfywlchSnIQVOzOQCO9tTSNccI
59+
artifact: /.*(\.|\.s)nupkg/
60+
on:
61+
APPVEYOR_REPO_TAG: true

src/CommandLine/UnParserExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private static string FormatValue(Specification spec, object value)
204204

205205
private static object FormatWithQuotesIfString(object value)
206206
{
207-
if (value is DateTime || value is TimeSpan || value is DateTimeOffset) return $"\"{value}\"";
207+
if (value is DateTime || value is DateTimeOffset) return $"\"{value}\"";
208208
Func<string, string> doubQt = v
209209
=> v.Contains("\"") ? v.Replace("\"", "\\\"") : v;
210210

tests/CommandLine.Tests/Unit/Core/InstanceBuilderTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,22 @@ public void Parse_TimeSpan()
10861086
expectedResult.Should().BeEquivalentTo(((Parsed<Options_With_TimeSpan>)result).Value);
10871087
}
10881088

1089+
#region Issue 579
1090+
[Fact]
1091+
public void Should_not_parse_quoted_TimeSpan()
1092+
{
1093+
// Exercize system
1094+
var result = InvokeBuild<Options_With_TimeSpan>(new[] { "--duration=\"00:42:00\"" });
1095+
1096+
var outcome = result as NotParsed<Options_With_TimeSpan>;
1097+
1098+
// Verify outcome
1099+
outcome.Should().NotBeNull();
1100+
outcome.Errors.Should().NotBeNullOrEmpty()
1101+
.And.HaveCount(1)
1102+
.And.OnlyContain(e => e.GetType().Equals(typeof(BadFormatConversionError)));
1103+
}
1104+
#endregion
10891105

10901106
[Fact]
10911107
public void OptionClass_IsImmutable_HasNoCtor()

tests/CommandLine.Tests/Unit/UnParserExtensionsTests.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ public static void UnParsing_instance_with_dash_in_value_and_dashdash_disabled_r
106106
.Should().BeEquivalentTo("-something with dash");
107107
}
108108

109+
#region Issue 579
110+
[Fact]
111+
public static void UnParsing_instance_with_TimeSpan_returns_the_value_unquoted_in_command_line()
112+
{
113+
var options = new Options_With_TimeSpan { Duration = TimeSpan.FromMinutes(1) };
114+
new Parser()
115+
.FormatCommandLine(options)
116+
.Should().Be("--duration 00:01:00");
117+
}
118+
#endregion
119+
109120
#region PR 550
110121

111122
[Fact]
@@ -175,7 +186,7 @@ public static void UnParsing_instance_with_timespan()
175186
var options = new Options_TimeSpan { Start = ts };
176187
var result = new Parser()
177188
.FormatCommandLine(options)
178-
.Should().BeEquivalentTo("--start \"01:02:03\"");
189+
.Should().BeEquivalentTo("--start 01:02:03"); //changed for issue 579
179190
}
180191

181192
[Theory]

0 commit comments

Comments
 (0)