Skip to content

Commit 47d8969

Browse files
committed
Merge branch 'readme' into develop
2 parents 00c34e8 + 86e2dba commit 47d8969

File tree

3 files changed

+103
-25
lines changed

3 files changed

+103
-25
lines changed

CHANGELOG.md

+32-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4+
CommandLineParser project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
## [2.7.0] - 2019-12-31
7+
### Added
8+
- Add option groups feature by [@hadzhiyski](https://github.com/commandlineparser/commandline/pull/552) - When one or more options has group set, at least one of these properties should have set value (they behave as required).
9+
- Add a new overload method for AutoBuild to enable HelpText customization by [@moh-hassan]().
10+
- Improve spacing in HelpText by [@asherber](https://github.com/commandlineparser/commandline/pull/494) by adding a new option in the HelpText.
11+
- Add a new option "SkipDefault" in UnParserSettings by [@moh-hassan](https://github.com/commandlineparser/commandline/pull/550) to add the ability of skipping the options with a default value and fix [#541](https://github.com/commandlineparser/commandline/issues/541).
12+
- Generate a new symbolic nuget Package by [@moh-hassan](https://github.com/commandlineparser/commandline/pull/554) to Improve the debugging of Applications with the NuGet package using [symbols experience](https://github.com/NuGet/Home/wiki/NuGet-Package-Debugging-&-Symbols-Improvements).
13+
- Add Support to [SourceLink](https://github.com/dotnet/sourcelink/blob/master/docs/README.md) in the nuget package [@moh-hassan](https://github.com/commandlineparser/commandline/pull/554).
14+
15+
### Changed
16+
- Remove the Exception when both CompanyAttribute and CopyRightAttribute are null in the Excuting assembly and set the copyright text to a default value.
17+
- Change default copyright to include current year instead of 1 by @moh-hassan.
18+
- Enabling c# 8 and Vs2019.
19+
20+
### Fixed
21+
- Fix NullReferenceException when creating a default immutable instance by [@0xced](https://github.com/commandlineparser/commandline/pull/495).
22+
- Fix issue [#496](https://github.com/commandlineparser/commandline/issues/496) - Cryptic error message with immutable option class by[@moh-hassan](https://github.com/commandlineparser/commandline/pull/555).
23+
- Fix UnParserExtensions.FormatCommandLine by [@moh-hassan](https://github.com/commandlineparser/commandline/pull/550) to resolve:
24+
- Fix Quote for Options of type DatTime [#502](https://github.com/commandlineparser/commandline/issues/502) and [#528](https://github.com/commandlineparser/commandline/issues/258).
25+
- Fix Quote for options of type TimeSpan and DateTimeOffset.
26+
- Fix Nullable type [#305](https://github.com/commandlineparser/commandline/issues/305)
27+
28+
- Fix nuget Licence in nuget package by [@moh-hassan](https://github.com/commandlineparser/commandline/pull/549) and fix issue [#545](https://github.com/commandlineparser/commandline/issues/545).
29+
- Fix PackageIconUrl warning in nuget package by [@moh-hassan](https://github.com/commandlineparser/commandline/pull/551).
30+
- Fix immutable nullException, Improve exception message when immutable type can't be created
31+
- Fix Custom help for verbs issue[#529](https://github.com/commandlineparser/commandline/issues/529)
32+
- Fix --help switch throwing exception in F# [#366](https://github.com/commandlineparser/commandline/issues/366)
33+
by [@WallaceKelly](https://github.com/commandlineparser/commandline/pull/493)
634

735
## [2.6.0] - 2019-07-31
836
### Added
@@ -48,7 +76,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4876
### Added
4977
- Add support to NetStandard2.0 by [@ViktorHofer](https://github.com/commandlineparser/commandline/pull/307)
5078
- Add strong name signing [@ViktorHofer](https://github.com/commandlineparser/commandline/pull/307)
51-
- Added AutoHelp and AutoVersion properties to control adding of implicit 'help' and 'version' options/verbs by [@Athari](https://github.com/commandlineparser/commandline/pull/256).
79+
- Added AutoBuild and AutoVersion properties to control adding of implicit 'help' and 'version' options/verbs by [@Athari](https://github.com/commandlineparser/commandline/pull/256).
5280
- Added simpler C# Quick Start example at readme.md by [@lythix](https://github.com/commandlineparser/commandline/pull/274).
5381
- Add validate feature in Set parameter, and throw exception, and show usage,Issue #283 by[@e673](https://github.com/commandlineparser/commandline/pull/286).
5482

@@ -92,5 +120,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
92120

93121
## [2.2.0] - 2018-01-07
94122

95-
## [1.9.71.2] - 2013-02-27
96-
The starting bascode version
123+
## [1.9.71.2] - 2013-02-27: The starting bascode version

README.md

+68-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build status](https://ci.appveyor.com/api/projects/status/p61dj8udxs2aocmo/branch/master?svg=true)](https://ci.appveyor.com/project/commandlineparser/commandline/branch/master)
22
[![NuGet](https://img.shields.io/nuget/dt/commandlineparser.svg)](http://nuget.org/packages/commandlineparser)
3-
[![NuGet](https://img.shields.io/nuget/v/commandlineparser.svg)](http://nuget.org/packages/commandlineparser)
4-
[![NuGet](https://img.shields.io/nuget/vpre/commandlineparser.svg)](http://nuget.org/packages/commandlineparser)
3+
[![NuGet](https://img.shields.io/nuget/v/commandlineparser.svg)](https://www.nuget.org/packages/CommandLineParser/)
4+
[![NuGet](https://img.shields.io/nuget/vpre/commandlineparser.svg)](https://www.nuget.org/packages/CommandLineParser.FSharp/)
55
[![Join the Gitter chat!](https://badges.gitter.im/gsscoder/commandline.svg)](https://gitter.im/gsscoder/commandline?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

77
# Command Line Parser Library for CLR and NetStandard
@@ -20,14 +20,19 @@ __This library provides _hassle free_ command line parsing with a constantly upd
2020

2121
# At a glance:
2222

23-
- Compatible with __.NET Framework 4.0+__, __Mono 2.1+ Profile__, and __.NET Core__
23+
- Compatible with __.NET Framework 4.0+__, __Mono 2.1+ Profile__, __.NET Standard__ and __.NET Core__
2424
- Doesn't depend on other packages (No dependencies beyond standard base libraries)
2525
- One line parsing using default singleton: `CommandLine.Parser.Default.ParseArguments(...)`.
2626
- Automatic or one line help screen generator: `HelpText.AutoBuild(...)`.
27-
- Supports `--help`, `--version`, `version` and `help [verb]` by default.
27+
- Supports `--help`, `--version`, `version` and `help [verb]` by default with customization.
2828
- Map to sequences (via `IEnumerable<T>` and similar) and scalar types, including Enums and `Nullable<T>`.
2929
- You can also map to every type with a constructor that accepts a string (like `System.Uri`).
3030
- Define [verb commands](https://github.com/commandlineparser/commandline/wiki/Verbs) similar to `git commit -a`.
31+
- Support HelpText localization.
32+
- Support ordering of options in HelpText.
33+
- Support [Mutually Exclusive Options](https://github.com/commandlineparser/commandline/wiki/Mutually-Exclusive-Options) and Options groups.
34+
- Support named and value options.
35+
- Support Asynchronous programming with async and await.
3136
- Unparsing support: `CommandLine.Parser.Default.FormatCommandLine<T>(T options)`.
3237
- CommandLineParser.FSharp package is F#-friendly with support for `option<'a>`, see [demo](https://github.com/commandlineparser/commandline/blob/master/demo/fsharp-demo.fsx). _NOTE: This is a separate NuGet package._
3338
- Most of features applies with a [CoC](http://en.wikipedia.org/wiki/Convention_over_configuration) philosophy.
@@ -48,7 +53,7 @@ You can utilize the parser library in several ways:
4853

4954
C# Quick Start:
5055

51-
```csharp
56+
```cs
5257
using System;
5358
using CommandLine;
5459

@@ -83,9 +88,13 @@ namespace QuickStart
8388
}
8489
```
8590

86-
C# Examples:
91+
## C# Examples:
92+
93+
<details>
94+
<summary>Click to expand!</summary>
95+
96+
```cs
8797

88-
```csharp
8998
class Options
9099
{
91100
[Option('r', "read", Required = true, HelpText = "Input files to be processed.")]
@@ -109,14 +118,31 @@ class Options
109118
static void Main(string[] args)
110119
{
111120
CommandLine.Parser.Default.ParseArguments<Options>(args)
112-
.WithParsed<Options>(opts => RunOptionsAndReturnExitCode(opts))
113-
.WithNotParsed<Options>((errs) => HandleParseError(errs));
121+
.WithParsed(RunOptions)
122+
.WithNotParsed(HandleParseError);
123+
}
124+
static void RunOptions(Options opts)
125+
{
126+
//handle options
114127
}
128+
static void HandleParseError(IEnumerable<Error> errs)
129+
{
130+
//handle errors
131+
}
132+
115133
```
116134

117-
F# Examples:
135+
</details>
136+
137+
Demo to show IEnumerable options and other usage: [Online Demo](https://dotnetfiddle.net/wrcAxr)
138+
139+
## F# Examples:
140+
141+
<details>
142+
<summary>Click to expand!</summary>
118143

119144
```fsharp
145+
120146
type options = {
121147
[<Option('r', "read", Required = true, HelpText = "Input files.")>] files : seq<string>;
122148
[<Option(HelpText = "Prints all messages to standard output.")>] verbose : bool;
@@ -130,10 +156,15 @@ let main argv =
130156
| :? Parsed<options> as parsed -> run parsed.Value
131157
| :? NotParsed<options> as notParsed -> fail notParsed.Errors
132158
```
159+
</details>
160+
161+
## VB.NET Example:
162+
163+
<details>
164+
<summary>Click to expand!</summary>
133165

134-
VB.NET:
166+
```vb
135167

136-
```VB.NET
137168
Class Options
138169
<CommandLine.Option('r', "read", Required := true,
139170
HelpText:="Input files to be processed.")>
@@ -159,14 +190,19 @@ Sub Main(ByVal args As String())
159190
.WithNotParsed(Function(errs As IEnumerable(Of [Error])) 1)
160191
End Sub
161192
```
193+
</details>
162194

163-
### For verbs:
195+
## For verbs:
164196

165197
1. Create separate option classes for each verb. An options base class is supported.
166198
2. Call ParseArguments with all the verb attribute decorated options classes.
167199
3. Use MapResult to direct program flow to the verb that was parsed.
168200

169-
C# example:
201+
### C# example:
202+
203+
204+
<details>
205+
<summary>Click to expand!</summary>
170206

171207
```csharp
172208
[Verb("add", HelpText = "Add file contents to the index.")]
@@ -191,10 +227,15 @@ int Main(string[] args) {
191227
errs => 1);
192228
}
193229
```
230+
</details>
231+
232+
### VB.NET example:
194233

195-
VB.NET example:
196234

197-
```VB.NET
235+
<details>
236+
<summary>Click to expand!</summary>
237+
238+
```vb
198239
<CommandLine.Verb("add", HelpText:="Add file contents to the index.")>
199240
Public Class AddOptions
200241
'Normal options here
@@ -218,10 +259,14 @@ Function Main(ByVal args As String()) As Integer
218259
)
219260
End Function
220261
```
262+
</details>
221263

222-
F# Example:
264+
### F# Example:
223265

224-
```fsharp
266+
<details>
267+
<summary>Click to expand!</summary>
268+
269+
```fs
225270
open CommandLine
226271
227272
[<Verb("add", HelpText = "Add file contents to the index.")>]
@@ -248,6 +293,11 @@ let main args =
248293
| :? CloneOptions as opts -> RunCloneAndReturnExitCode opts
249294
| :? CommandLine.NotParsed<obj> -> 1
250295
```
296+
</details>
297+
298+
# Release History
299+
300+
See the [changelog](CHANGELOG.md)
251301

252302
# Contributors
253303
First off, _Thank you!_ All contributions are welcome.

src/CommandLine/CommandLine.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<PackageIcon>CommandLine20.png</PackageIcon>
2323
<PackageProjectUrl>https://github.com/commandlineparser/commandline</PackageProjectUrl>
2424
<PackageTags>command line;commandline;argument;option;parser;parsing;library;syntax;shell</PackageTags>
25+
<PackageReleaseNotes>https://github.com/commandlineparser/commandline/blob/master/CHANGELOG.md</PackageReleaseNotes>
2526
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2627
<LangVersion>8.0</LangVersion>
2728
<IncludeSymbols>true</IncludeSymbols>
@@ -47,7 +48,7 @@
4748
<PackageReference Include="FSharp.Core" Version="4.0.0.1" Condition="'$(BuildTarget)' == 'fsharp'" />
4849
</ItemGroup>
4950
<ItemGroup>
50-
<None Include="$(SolutionDir)LICENSE.md" Pack="true" PackagePath=""/>
51-
<None Include="$(SolutionDir)art\CommandLine20.png" Pack="true" PackagePath=""/>
51+
<None Include="..\..\LICENSE.md" Pack="true" PackagePath=""/>
52+
<None Include="..\..\art\CommandLine20.png" Pack="true" PackagePath=""/>
5253
</ItemGroup>
5354
</Project>

0 commit comments

Comments
 (0)