Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/cd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
- name: Restore dependencies
run: dotnet restore src/MinimalCli.sln
# build solution here instead of project
- name: Build Minimal CommandLine
- name: Build Minimal Command Line
run: dotnet build src/MinimalCli.sln -c Release --no-restore

# packs all nuget packages at once
- name: Pack MinimalCommandLine Nuget Alpha
run: dotnet pack src/MinimalCli/MinimalCli.csproj -p:PackageVersion=0.5.0.${{github.run_number}}-alpha -o ./packages
- name: Pack MinimalCommandLine Nuget
run: dotnet pack src/MinimalCli/MinimalCli.csproj -p:PackageVersion=0.5.0.${{github.run_number}} -o ./packages
- name: Pack Minimal Command Line Nuget Alpha
run: dotnet pack src/MinimalCli/MinimalCli.csproj -p:PackageVersion=2.0.0.${{github.run_number}}-alpha -o ./packages
- name: Pack Minimal Command Line Nuget
run: dotnet pack src/MinimalCli/MinimalCli.csproj -p:PackageVersion=2.0.0.${{github.run_number}} -o ./packages

- name: Publish MinimalCommandLine Artifacts
- name: Publish Minimal Command Line Artifacts
uses: actions/upload-artifact@v4
with:
name: Nugets
Expand All @@ -50,8 +50,8 @@ jobs:

- name: Display structure of downloaded files
run: ls -R
- name: Push MinimalCommandLine Nuget
run: dotnet nuget push ./MinimalCli.0.5.0.${{github.run_number}}-alpha.nupkg --api-key ${{secrets.NUGETKEY}} --source https://api.nuget.org/v3/index.json
- name: Push Minimal Command Line Nuget
run: dotnet nuget push ./MinimalCli.2.0.0.${{github.run_number}}-alpha.nupkg --api-key ${{secrets.NUGETKEY}} --source https://api.nuget.org/v3/index.json

production:
needs: integration
Expand All @@ -65,5 +65,5 @@ jobs:
with:
name: Nugets

- name: Push MinimalCommandLine Nuget
run: dotnet nuget push ./MinimalCli.0.5.0.${{github.run_number}}.nupkg --api-key ${{secrets.NUGETKEY}} --source https://api.nuget.org/v3/index.json
- name: Push Minimal Command Line Nuget
run: dotnet nuget push ./MinimalCli.2.0.0.${{github.run_number}}.nupkg --api-key ${{secrets.NUGETKEY}} --source https://api.nuget.org/v3/index.json
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# System.CommandLine.Minimal
# MinimalCli

> A source generator that sits on top of the `System.CommandLine` namespace
> A source generator that works with the `System.CommandLine` namespace
> to give an experience similar to the ASP.Net Core minimal API builders. This library
> uses the Hosting libraries so a dotnet developer feels at home.
>
Expand Down Expand Up @@ -52,7 +52,7 @@ will map the parameter `message` to a string Argument called `<Message>`.

Add a reference to the nuget package `MinimalCommandLine`.

- Via csproj: `<PackageReference Include="MinimalCommandLine" Version="0.5.0.10" />`
- Via csproj: `<PackageReference Include="MinimalCommandLine" Version="2.0.0.36" />`
- Via dotnet cli: `dotnet package add MinimalCommandLine`
- Via Visual Studio Menu:
* Tools >
Expand All @@ -74,7 +74,7 @@ using MinimalCli;

public class MyCommand
{
[Handler("mycommand")]
[Handler("my-command")]
public void Run(string myArgument, string? myOption = null)
{
Console.WriteLine("Arg:{0}, Option:{0}", myArgument, myOption);
Expand All @@ -83,14 +83,14 @@ public class MyCommand
```

This registers the following:
* A command called `mycommand` to the handler `void Run(..)`.
* A command called `my-command` to the handler `void Run(..)`.
* The parameter `myArgument` to an Argument called `<MyArgument>`.
* The optional parameter `myOption` to an Option called `--my-option`.

The command can be called like this:

```bash
mycommand "Foo" --my-option "Bar"
my-command "Foo" --my-option "Bar"
```

Conventionally a `System.CommandLine.Argument` is created when the parameter is required and
Expand All @@ -105,7 +105,7 @@ using MinimalCli;

public class MyCommand
{
[Handler("mycommand")]
[Handler("my-command")]
public void Execute(string myArgument, [Argument] string? myArgument2 = null)
{
Console.WriteLine("Arg:{0}, Arg2:{0}", myArgument, myArgument2);
Expand Down
2 changes: 1 addition & 1 deletion src/DemoApp/DemoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<!--<ItemGroup>
<PackageReference Include="MinimalCommandLine" Version="0.5.1-alpha" />
<PackageReference Include="MinimalCli" Version="2.0.0.36-alpha" />
</ItemGroup>-->

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<!--<ItemGroup>
<PackageReference Include="MinimalCommandLine" Version="0.5.1-alpha" />
<PackageReference Include="MinimalCli" Version="2.0.0.36-alpha" />
</ItemGroup>-->

<ItemGroup>
Expand Down
Loading