Skip to content

Commit

Permalink
Add a README_nuget markdown file (kutoga#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
kutoga authored Oct 18, 2019
1 parent 8da6dfa commit 0570a4e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
5 changes: 5 additions & 0 deletions build_readme.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"

echo "$(date) Start building README.md..."
python3 ./doc/scripts/include_resolve.py ./doc/README.md.template > ./README.md
echo "$(date) Built README.md..."

echo "$(date) Start building README_nuget.md..."
python3 ./doc/scripts/include_resolve.py ./doc/README_nuget.md.template > ./doc/README_nuget.md
echo "$(date) Built README_nuget.md..."

33 changes: 33 additions & 0 deletions doc/README_nuget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FluentArgs is a library to parse command line arguments. It focuses on a very simple API and
strong typing. It is able to generate a help view and proper error messages.

Example code:
```csharp
namespace Example
{
using System;
using System.Threading.Tasks;
using FluentArgs;

public static class Program
{
public static void Main(string[] args)
{
FluentArgsBuilder.New()
.Parameter("-i", "--input").IsRequired()
.Parameter("-o", "--output").IsRequired()
.Parameter<ushort>("-q", "--quality")
.WithValidation(n => n >= 0 && n <= 100)
.IsOptionalWithDefault(50)
.Call(quality => outputFile => inputFile =>
{
/* ... */
Console.WriteLine($"Convert {inputFile} to {outputFile} with quality {quality}...");
/* ... */
})
.Parse(args);
}
}
}
```

8 changes: 8 additions & 0 deletions doc/README_nuget.md.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FluentArgs is a library to parse command line arguments. It focuses on a very simple API and
strong typing. It is able to generate a help view and proper error messages.

Example code:
```csharp
!INCLUDE:examples/Simple01.cs
```

13 changes: 11 additions & 2 deletions doc/scripts/test_readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@ set -e
cd "$(dirname "$0")/../.."

mv README.md .README.md.org
mv doc/README_nuget.md doc/.README_nuget.md.org

echo "Build README..."
bash ./build_readme.sh

echo "Compare built README with existing README (their contet should be equivalent)..."
if ! diff README.md .README.md.org; then
mv .README.md.org README.md
echo "FAILED! README content does not seem to be up-to-date."
echo "FAILED! README.md content does not seem to be up-to-date."
echo "Please execute ./build_readme.sh"
exit 1
else
mv .README.md.org README.md
echo "Everything is fine :)"
echo "README.md is up-to-date!"
fi
if ! diff doc/README_nuget.md doc/.README_nuget.md.org; then
mv doc/.README_nuget.md.org doc/README_nuget.md
echo "FAILED! doc/README_nuget.md content does not seem to be up-to-date."
echo "Please execute ./build_readme.sh"
exit 1
else
mv doc/.README_nuget.md.org doc/README_nuget.md
fi

0 comments on commit 0570a4e

Please sign in to comment.