diff --git a/.github/workflows/cd-build.yml b/.github/workflows/cd-build.yml
index b0bee30..a206aa5 100644
--- a/.github/workflows/cd-build.yml
+++ b/.github/workflows/cd-build.yml
@@ -18,16 +18,16 @@ jobs:
dotnet-version: 8.0.x
- name: Restore dependencies
- run: dotnet restore src/System.CommandLine.Minimal.sln
+ run: dotnet restore src/MinimalCli.sln
# build solution here instead of project
- name: Build Minimal CommandLine
- run: dotnet build src/System.CommandLine.Minimal.sln -c Release --no-restore
+ 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/System.CommandLine.Minimal/System.CommandLine.Minimal.csproj -p:PackageVersion=0.5.0.${{github.run_number}}-alpha -o ./packages
+ 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/System.CommandLine.Minimal/System.CommandLine.Minimal.csproj -p:PackageVersion=0.5.0.${{github.run_number}} -o ./packages
+ run: dotnet pack src/MinimalCli/MinimalCli.csproj -p:PackageVersion=0.5.0.${{github.run_number}} -o ./packages
- name: Publish MinimalCommandLine Artifacts
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml
index e686d62..76617e3 100644
--- a/.github/workflows/pr-build.yml
+++ b/.github/workflows/pr-build.yml
@@ -16,10 +16,10 @@ jobs:
dotnet-version: 8.0.x
- name: Restore dependencies
- run: dotnet restore src/System.CommandLine.Minimal.sln
+ run: dotnet restore src/MinimalCli.sln
- name: Build Minimal CommandLine
- run: dotnet build src/System.CommandLine.Minimal.sln -c Release --no-restore
+ run: dotnet build src/MinimalCli.sln -c Release --no-restore
- name: Build HelloWorld Demo
run: dotnet build src/HelloWorld/HelloWorld.csproj -c Release --no-restore
diff --git a/README.md b/README.md
index 6cbf7d8..b58f5fa 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
First, create a new console application, then create a class to house the logic for your command:
```csharp
-using System.CommandLine.Minimal;
+using MinimalCli;
public class HelloWorld
{
@@ -33,7 +33,7 @@ public class HelloWorld
Next, setup your Console App's `Program.cs` file:
```csharp
-using System.CommandLine.Minimal;
+using MinimalCli;
var builder = new MinimalCommandLineBuilder(args)
@@ -70,7 +70,7 @@ Add a reference to the nuget package `MinimalCommandLine`.
A simple command with an Argument and an Option:
```csharp
-using System.CommandLine.Minimal;
+using MinimalCli;
public class MyCommand
{
@@ -101,7 +101,7 @@ a `System.CommandLine.Option` is created when the parameter is optional.
A simple command with two Arguments: a required Argument and an optional Argument:
```csharp
-using System.CommandLine.Minimal;
+using MinimalCli;
public class MyCommand
{
@@ -123,7 +123,7 @@ registering a command, the source generator creates an extension method that you
the descriptions, aliases, default values, and any other System.CommandLine functionality.
```csharp
-using System.CommandLine.Minimal;
+using MinimalCli;
// after creating a 'greet' command that accepts a 'name' argument:
diff --git a/src/DemoApp/DemoApp.csproj b/src/DemoApp/DemoApp.csproj
index f05c93a..e78e981 100644
--- a/src/DemoApp/DemoApp.csproj
+++ b/src/DemoApp/DemoApp.csproj
@@ -15,8 +15,8 @@
-->
-
-
+
+
Analyzer
false
diff --git a/src/DemoApp/Program.cs b/src/DemoApp/Program.cs
index 46103d0..2608c3d 100644
--- a/src/DemoApp/Program.cs
+++ b/src/DemoApp/Program.cs
@@ -1,7 +1,7 @@
using DemoApp.Services;
using Microsoft.Extensions.DependencyInjection;
using System.CommandLine;
-using System.CommandLine.Minimal;
+using MinimalCli;
MinimalCommandLineBuilder builder = new(args);
diff --git a/src/DemoApp/Services/IntermediateCaGenerator.cs b/src/DemoApp/Services/IntermediateCaGenerator.cs
index f1f0f31..a64ab15 100644
--- a/src/DemoApp/Services/IntermediateCaGenerator.cs
+++ b/src/DemoApp/Services/IntermediateCaGenerator.cs
@@ -1,4 +1,4 @@
-using System.CommandLine.Minimal;
+using MinimalCli;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
diff --git a/src/DemoApp/Services/RootCaGenerator.cs b/src/DemoApp/Services/RootCaGenerator.cs
index b3146e5..c30a92e 100644
--- a/src/DemoApp/Services/RootCaGenerator.cs
+++ b/src/DemoApp/Services/RootCaGenerator.cs
@@ -1,4 +1,4 @@
-using System.CommandLine.Minimal;
+using MinimalCli;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
diff --git a/src/DemoApp/Services/SSLCertificateGenerator.cs b/src/DemoApp/Services/SSLCertificateGenerator.cs
index a63a9eb..8d3c9d6 100644
--- a/src/DemoApp/Services/SSLCertificateGenerator.cs
+++ b/src/DemoApp/Services/SSLCertificateGenerator.cs
@@ -1,4 +1,4 @@
-using System.CommandLine.Minimal;
+using MinimalCli;
using System.Net;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
diff --git a/src/HelloWorld/HelloWorld.csproj b/src/HelloWorld/HelloWorld.csproj
index b7af6d0..ad623de 100644
--- a/src/HelloWorld/HelloWorld.csproj
+++ b/src/HelloWorld/HelloWorld.csproj
@@ -15,8 +15,8 @@
-->
-
-
+
+
Analyzer
false
diff --git a/src/HelloWorld/HelloWorldClass.cs b/src/HelloWorld/HelloWorldClass.cs
index d9c0a79..4aa4945 100644
--- a/src/HelloWorld/HelloWorldClass.cs
+++ b/src/HelloWorld/HelloWorldClass.cs
@@ -1,5 +1,4 @@
-using System.CommandLine;
-using System.CommandLine.Minimal;
+using MinimalCli;
namespace Hello;
diff --git a/src/HelloWorld/Program.cs b/src/HelloWorld/Program.cs
index 5b8028a..cff821d 100644
--- a/src/HelloWorld/Program.cs
+++ b/src/HelloWorld/Program.cs
@@ -1,4 +1,4 @@
-using System.CommandLine.Minimal;
+using MinimalCli;
MinimalCommandLineBuilder builder = new(args);
diff --git a/src/System.CommandLine.Minimal.Core/ArgumentAttribute.cs b/src/MinimalCli.Core/ArgumentAttribute.cs
similarity index 73%
rename from src/System.CommandLine.Minimal.Core/ArgumentAttribute.cs
rename to src/MinimalCli.Core/ArgumentAttribute.cs
index 085cde5..51178e4 100644
--- a/src/System.CommandLine.Minimal.Core/ArgumentAttribute.cs
+++ b/src/MinimalCli.Core/ArgumentAttribute.cs
@@ -1,4 +1,6 @@
-namespace System.CommandLine.Minimal;
+using System;
+
+namespace MinimalCli;
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
public class ArgumentAttribute : Attribute
diff --git a/src/System.CommandLine.Minimal.Core/ArgumentBuilder.cs b/src/MinimalCli.Core/ArgumentBuilder.cs
similarity index 95%
rename from src/System.CommandLine.Minimal.Core/ArgumentBuilder.cs
rename to src/MinimalCli.Core/ArgumentBuilder.cs
index cffa9e5..3b44a3a 100644
--- a/src/System.CommandLine.Minimal.Core/ArgumentBuilder.cs
+++ b/src/MinimalCli.Core/ArgumentBuilder.cs
@@ -1,4 +1,6 @@
-namespace System.CommandLine.Minimal;
+using System.CommandLine;
+
+namespace MinimalCli;
public class ArgumentBuilder
{
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/ArgumentBinding.cs b/src/MinimalCli.Core/Bindings/ArgumentBinding.cs
similarity index 74%
rename from src/System.CommandLine.Minimal.Core/Bindings/ArgumentBinding.cs
rename to src/MinimalCli.Core/Bindings/ArgumentBinding.cs
index 23ad574..674fe70 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/ArgumentBinding.cs
+++ b/src/MinimalCli.Core/Bindings/ArgumentBinding.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal.Bindings;
+namespace MinimalCli.Bindings;
public record ArgumentBinding(string ParameterName, Type ParameterType, Argument Argument)
: ParameterBinding(ParameterName, ParameterType)
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/CommandBinding.cs b/src/MinimalCli.Core/Bindings/CommandBinding.cs
similarity index 90%
rename from src/System.CommandLine.Minimal.Core/Bindings/CommandBinding.cs
rename to src/MinimalCli.Core/Bindings/CommandBinding.cs
index ecbf65d..9046c20 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/CommandBinding.cs
+++ b/src/MinimalCli.Core/Bindings/CommandBinding.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace System.CommandLine.Minimal.Bindings;
+namespace MinimalCli.Bindings;
public abstract class CommandBinding
{
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/CommandBindingFactory.cs b/src/MinimalCli.Core/Bindings/CommandBindingFactory.cs
similarity index 92%
rename from src/System.CommandLine.Minimal.Core/Bindings/CommandBindingFactory.cs
rename to src/MinimalCli.Core/Bindings/CommandBindingFactory.cs
index 4400c26..ca50724 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/CommandBindingFactory.cs
+++ b/src/MinimalCli.Core/Bindings/CommandBindingFactory.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace System.CommandLine.Minimal.Bindings;
+namespace MinimalCli.Bindings;
public class CommandBindingFactory
{
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/CommandOptions.cs b/src/MinimalCli.Core/Bindings/CommandOptions.cs
similarity index 75%
rename from src/System.CommandLine.Minimal.Core/Bindings/CommandOptions.cs
rename to src/MinimalCli.Core/Bindings/CommandOptions.cs
index f327849..d98e6d4 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/CommandOptions.cs
+++ b/src/MinimalCli.Core/Bindings/CommandOptions.cs
@@ -1,7 +1,9 @@
-using System.Threading;
+using System;
+using System.CommandLine;
+using System.Threading;
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal.Bindings;
+namespace MinimalCli.Bindings;
public abstract class CommandOptions
{
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/DependencyInjectionBinding.cs b/src/MinimalCli.Core/Bindings/DependencyInjectionBinding.cs
similarity index 73%
rename from src/System.CommandLine.Minimal.Core/Bindings/DependencyInjectionBinding.cs
rename to src/MinimalCli.Core/Bindings/DependencyInjectionBinding.cs
index 9973caf..a8465fa 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/DependencyInjectionBinding.cs
+++ b/src/MinimalCli.Core/Bindings/DependencyInjectionBinding.cs
@@ -1,4 +1,6 @@
-namespace System.CommandLine.Minimal.Bindings;
+using System;
+
+namespace MinimalCli.Bindings;
public record DependencyInjectionBinding(string ParameterName, Type ParameterType)
: ParameterBinding(ParameterName, ParameterType)
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/OptionBinding.cs b/src/MinimalCli.Core/Bindings/OptionBinding.cs
similarity index 74%
rename from src/System.CommandLine.Minimal.Core/Bindings/OptionBinding.cs
rename to src/MinimalCli.Core/Bindings/OptionBinding.cs
index d8f7724..d2f8297 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/OptionBinding.cs
+++ b/src/MinimalCli.Core/Bindings/OptionBinding.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal.Bindings;
+namespace MinimalCli.Bindings;
public record OptionBinding(string ParameterName, Type ParameterType, Option Option)
: ParameterBinding(ParameterName, ParameterType)
diff --git a/src/System.CommandLine.Minimal.Core/Bindings/ParameterBinding.cs b/src/MinimalCli.Core/Bindings/ParameterBinding.cs
similarity index 62%
rename from src/System.CommandLine.Minimal.Core/Bindings/ParameterBinding.cs
rename to src/MinimalCli.Core/Bindings/ParameterBinding.cs
index 6ca4a03..a98ef54 100644
--- a/src/System.CommandLine.Minimal.Core/Bindings/ParameterBinding.cs
+++ b/src/MinimalCli.Core/Bindings/ParameterBinding.cs
@@ -1,3 +1,5 @@
-namespace System.CommandLine.Minimal.Bindings;
+using System;
+
+namespace MinimalCli.Bindings;
public abstract record ParameterBinding(string ParameterName, Type ParameterType);
diff --git a/src/System.CommandLine.Minimal.Core/CommandBuilder.cs b/src/MinimalCli.Core/CommandBuilder.cs
similarity index 99%
rename from src/System.CommandLine.Minimal.Core/CommandBuilder.cs
rename to src/MinimalCli.Core/CommandBuilder.cs
index f607d4c..93e5518 100644
--- a/src/System.CommandLine.Minimal.Core/CommandBuilder.cs
+++ b/src/MinimalCli.Core/CommandBuilder.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
public class CommandBuilder
{
diff --git a/src/System.CommandLine.Minimal.Core/CommandBuilderOfT.cs b/src/MinimalCli.Core/CommandBuilderOfT.cs
similarity index 98%
rename from src/System.CommandLine.Minimal.Core/CommandBuilderOfT.cs
rename to src/MinimalCli.Core/CommandBuilderOfT.cs
index d0625ee..6fa7304 100644
--- a/src/System.CommandLine.Minimal.Core/CommandBuilderOfT.cs
+++ b/src/MinimalCli.Core/CommandBuilderOfT.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
public class CommandBuilder
where THandler : notnull
diff --git a/src/System.CommandLine.Minimal.Core/CommandExecutionMode.cs b/src/MinimalCli.Core/CommandExecutionMode.cs
similarity index 72%
rename from src/System.CommandLine.Minimal.Core/CommandExecutionMode.cs
rename to src/MinimalCli.Core/CommandExecutionMode.cs
index 2f56135..30a4a27 100644
--- a/src/System.CommandLine.Minimal.Core/CommandExecutionMode.cs
+++ b/src/MinimalCli.Core/CommandExecutionMode.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
public enum CommandExecutionMode
{
diff --git a/src/System.CommandLine.Minimal.Core/CommandExecutorCli.cs b/src/MinimalCli.Core/CommandExecutorCli.cs
similarity index 95%
rename from src/System.CommandLine.Minimal.Core/CommandExecutorCli.cs
rename to src/MinimalCli.Core/CommandExecutorCli.cs
index 056749f..59c3900 100644
--- a/src/System.CommandLine.Minimal.Core/CommandExecutorCli.cs
+++ b/src/MinimalCli.Core/CommandExecutorCli.cs
@@ -1,9 +1,9 @@
using Microsoft.Extensions.Hosting;
-using System.CommandLine.Minimal.Bindings;
+using MinimalCli.Bindings;
using System.CommandLine.Parsing;
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
internal class CommandExecutorCli : ICommandExecutor
{
diff --git a/src/System.CommandLine.Minimal.Core/CommandExecutorShell.cs b/src/MinimalCli.Core/CommandExecutorShell.cs
similarity index 86%
rename from src/System.CommandLine.Minimal.Core/CommandExecutorShell.cs
rename to src/MinimalCli.Core/CommandExecutorShell.cs
index b0c90f9..961478b 100644
--- a/src/System.CommandLine.Minimal.Core/CommandExecutorShell.cs
+++ b/src/MinimalCli.Core/CommandExecutorShell.cs
@@ -1,8 +1,9 @@
using Microsoft.Extensions.Hosting;
using System.CommandLine.Parsing;
+using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
internal class CommandExecutorShell : ICommandExecutor
{
@@ -24,7 +25,7 @@ public void SetExitCommands(string[] exitCommands)
this.exitCommands = exitCommands;
}
- [Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
+ [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
Justification = "This is not code that runs during analysis")]
public async Task ExecuteAsync(RootCommand rootCommand, string[] args)
{
@@ -53,7 +54,7 @@ public async Task ExecuteAsync(RootCommand rootCommand, string[] args)
return 0;
}
- [Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
+ [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
Justification = "This is not code that runs during analysis")]
public int Execute(RootCommand rootCommand, string[] args)
{
@@ -83,7 +84,7 @@ public int Execute(RootCommand rootCommand, string[] args)
return 0;
}
- [Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
Justification = "This is not code that runs during analysis")]
private static bool GetInput(RootCommand rootCommand, string prompt, string[] exitCommands, out ParseResult? result)
{
@@ -103,7 +104,7 @@ private static bool GetInput(RootCommand rootCommand, string prompt, string[] ex
return true;
}
- [Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
+ [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1035:Do not use APIs banned for analyzers",
Justification = "This is not code that runs during analysis")]
private static void ShowParserErrors(ParseResult result)
{
diff --git a/src/System.CommandLine.Minimal.Core/FromServicesAttribute.cs b/src/MinimalCli.Core/FromServicesAttribute.cs
similarity index 74%
rename from src/System.CommandLine.Minimal.Core/FromServicesAttribute.cs
rename to src/MinimalCli.Core/FromServicesAttribute.cs
index a2d9059..23620e4 100644
--- a/src/System.CommandLine.Minimal.Core/FromServicesAttribute.cs
+++ b/src/MinimalCli.Core/FromServicesAttribute.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
public class FromServicesAttribute : Attribute
diff --git a/src/System.CommandLine.Minimal.Core/HandlerAttribute.cs b/src/MinimalCli.Core/HandlerAttribute.cs
similarity index 81%
rename from src/System.CommandLine.Minimal.Core/HandlerAttribute.cs
rename to src/MinimalCli.Core/HandlerAttribute.cs
index 6c59ba2..9c3bb8c 100644
--- a/src/System.CommandLine.Minimal.Core/HandlerAttribute.cs
+++ b/src/MinimalCli.Core/HandlerAttribute.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
[AttributeUsage(AttributeTargets.Method)]
public sealed class HandlerAttribute : Attribute
diff --git a/src/System.CommandLine.Minimal.Core/ICommandExecutor.cs b/src/MinimalCli.Core/ICommandExecutor.cs
similarity index 84%
rename from src/System.CommandLine.Minimal.Core/ICommandExecutor.cs
rename to src/MinimalCli.Core/ICommandExecutor.cs
index 1292508..d0536b0 100644
--- a/src/System.CommandLine.Minimal.Core/ICommandExecutor.cs
+++ b/src/MinimalCli.Core/ICommandExecutor.cs
@@ -1,6 +1,6 @@
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
internal interface ICommandExecutor
{
diff --git a/src/System.CommandLine.Minimal.Core/IsExternalInit.cs b/src/MinimalCli.Core/IsExternalInit.cs
similarity index 100%
rename from src/System.CommandLine.Minimal.Core/IsExternalInit.cs
rename to src/MinimalCli.Core/IsExternalInit.cs
diff --git a/src/System.CommandLine.Minimal.Core/System.CommandLine.Minimal.Core.csproj b/src/MinimalCli.Core/MinimalCli.Core.csproj
similarity index 93%
rename from src/System.CommandLine.Minimal.Core/System.CommandLine.Minimal.Core.csproj
rename to src/MinimalCli.Core/MinimalCli.Core.csproj
index f8860da..83070ad 100644
--- a/src/System.CommandLine.Minimal.Core/System.CommandLine.Minimal.Core.csproj
+++ b/src/MinimalCli.Core/MinimalCli.Core.csproj
@@ -12,7 +12,7 @@
https://github.com/dotnetKyle/MinimalCommandLine
Command; Line
embedded
- System.CommandLine.Minimal
+ MinimalCli
diff --git a/src/System.CommandLine.Minimal.Core/MinimalCommandLineApp.cs b/src/MinimalCli.Core/MinimalCommandLineApp.cs
similarity index 99%
rename from src/System.CommandLine.Minimal.Core/MinimalCommandLineApp.cs
rename to src/MinimalCli.Core/MinimalCommandLineApp.cs
index a963ef9..7575c82 100644
--- a/src/System.CommandLine.Minimal.Core/MinimalCommandLineApp.cs
+++ b/src/MinimalCli.Core/MinimalCommandLineApp.cs
@@ -2,12 +2,12 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Collections.Generic;
-using System.CommandLine.Minimal.Bindings;
+using MinimalCli.Bindings;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
public class MinimalCommandLineApp : IHostedService
{
diff --git a/src/System.CommandLine.Minimal.Core/MinimalCommandLineBuilder.cs b/src/MinimalCli.Core/MinimalCommandLineBuilder.cs
similarity index 98%
rename from src/System.CommandLine.Minimal.Core/MinimalCommandLineBuilder.cs
rename to src/MinimalCli.Core/MinimalCommandLineBuilder.cs
index e66969a..26a3775 100644
--- a/src/System.CommandLine.Minimal.Core/MinimalCommandLineBuilder.cs
+++ b/src/MinimalCli.Core/MinimalCommandLineBuilder.cs
@@ -4,9 +4,9 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
-using System.CommandLine.Minimal.Bindings;
+using MinimalCli.Bindings;
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
public class MinimalCommandLineBuilder : IHostApplicationBuilder
{
diff --git a/src/System.CommandLine.Minimal.Core/OptionAttribute.cs b/src/MinimalCli.Core/OptionAttribute.cs
similarity index 73%
rename from src/System.CommandLine.Minimal.Core/OptionAttribute.cs
rename to src/MinimalCli.Core/OptionAttribute.cs
index 5734bc4..520674a 100644
--- a/src/System.CommandLine.Minimal.Core/OptionAttribute.cs
+++ b/src/MinimalCli.Core/OptionAttribute.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
public class OptionAttribute : Attribute
diff --git a/src/System.CommandLine.Minimal.Core/OptionBuilder.cs b/src/MinimalCli.Core/OptionBuilder.cs
similarity index 95%
rename from src/System.CommandLine.Minimal.Core/OptionBuilder.cs
rename to src/MinimalCli.Core/OptionBuilder.cs
index 2259c93..aa0000b 100644
--- a/src/System.CommandLine.Minimal.Core/OptionBuilder.cs
+++ b/src/MinimalCli.Core/OptionBuilder.cs
@@ -1,4 +1,4 @@
-namespace System.CommandLine.Minimal;
+namespace MinimalCli;
public class OptionBuilder
{
diff --git a/src/MinimalCli.Core/_Imports.cs b/src/MinimalCli.Core/_Imports.cs
new file mode 100644
index 0000000..9ce5729
--- /dev/null
+++ b/src/MinimalCli.Core/_Imports.cs
@@ -0,0 +1,3 @@
+global using System;
+global using System.Collections.Generic;
+global using System.CommandLine;
\ No newline at end of file
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs b/src/MinimalCli.SourceGenerator/CommandOptionsWriter.cs
similarity index 98%
rename from src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs
rename to src/MinimalCli.SourceGenerator/CommandOptionsWriter.cs
index d9e96a9..b3a488b 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs
+++ b/src/MinimalCli.SourceGenerator/CommandOptionsWriter.cs
@@ -2,7 +2,7 @@
using System.Linq;
using System.Text;
-namespace System.CommandLine.Minimal.SourceGeneration;
+namespace MinimalCli.SourceGeneration;
internal static class CommandOptionsWriter
{
@@ -19,11 +19,11 @@ internal static class CommandOptionsWriter
using System;
using System.CommandLine;
using System.CommandLine.Invocation;
- using System.CommandLine.Minimal.Bindings;
+ using MinimalCli.Bindings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
- namespace System.CommandLine.Minimal
+ namespace MinimalCli
{
"""
);
@@ -215,7 +215,7 @@ public static class Configure{{binder.CommandNameTitleCase}}BuilderExtensions
}
- // end namespace System.CommandLine.Minimal
+ // end namespace MinimalCli
sb.AppendLine("}");
return sb.ToString();
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/CommandSourceGenerator.cs b/src/MinimalCli.SourceGenerator/CommandSourceGenerator.cs
similarity index 91%
rename from src/System.CommandLine.Minimal.SourceGenerator/CommandSourceGenerator.cs
rename to src/MinimalCli.SourceGenerator/CommandSourceGenerator.cs
index 0df4630..d83631b 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/CommandSourceGenerator.cs
+++ b/src/MinimalCli.SourceGenerator/CommandSourceGenerator.cs
@@ -2,10 +2,10 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Collections.Generic;
using System.Collections.Immutable;
-using System.CommandLine.Minimal.SourceGenerator;
+using MinimalCli.SourceGenerator;
using System.Threading;
-namespace System.CommandLine.Minimal.SourceGeneration;
+namespace MinimalCli.SourceGeneration;
[Generator]
public class CommandSourceGenerator : IIncrementalGenerator
@@ -18,7 +18,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
// attributes
IncrementalValueProvider> bindersProvider = context.SyntaxProvider
.ForAttributeWithMetadataName(
- "System.CommandLine.Minimal.HandlerAttribute",
+ "MinimalCli.HandlerAttribute",
predicate: MethodDeclPredicate,
transform: GeneratorBindingsProvider.Transform
).Collect();
@@ -70,9 +70,9 @@ internal static bool MethodDeclPredicate(SyntaxNode node, CancellationToken _)
// "RegisterCommandsHook.g.cs",
// """
// using System.CommandLine;
- // using System.CommandLine.Minimal;
+ // using MinimalCli;
- // namespace System.CommandLine.Minimal;
+ // namespace MinimalCli;
// public static partial class RegisterCommandsHook
// {
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/CommandSyntaxReceiver.cs b/src/MinimalCli.SourceGenerator/CommandSyntaxReceiver.cs
similarity index 89%
rename from src/System.CommandLine.Minimal.SourceGenerator/CommandSyntaxReceiver.cs
rename to src/MinimalCli.SourceGenerator/CommandSyntaxReceiver.cs
index dfe9995..d3defef 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/CommandSyntaxReceiver.cs
+++ b/src/MinimalCli.SourceGenerator/CommandSyntaxReceiver.cs
@@ -2,7 +2,7 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Collections.Generic;
-namespace System.CommandLine.Minimal.SourceGeneration;
+namespace MinimalCli.SourceGeneration;
public class CommandSyntaxReceiver : ISyntaxReceiver
{
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/Conventions/ParameterNameConversion.cs b/src/MinimalCli.SourceGenerator/Conventions/ParameterNameConversion.cs
similarity index 95%
rename from src/System.CommandLine.Minimal.SourceGenerator/Conventions/ParameterNameConversion.cs
rename to src/MinimalCli.SourceGenerator/Conventions/ParameterNameConversion.cs
index 92af4f7..ac20f39 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/Conventions/ParameterNameConversion.cs
+++ b/src/MinimalCli.SourceGenerator/Conventions/ParameterNameConversion.cs
@@ -1,7 +1,7 @@
using System.Globalization;
using System.Text.RegularExpressions;
-namespace System.CommandLine.Minimal.SourceGeneration.Conventions;
+namespace MinimalCli.SourceGeneration.Conventions;
internal static class ParameterNameConversion
{
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/Conventions/SymbolFormattingExtensions.cs b/src/MinimalCli.SourceGenerator/Conventions/SymbolFormattingExtensions.cs
similarity index 96%
rename from src/System.CommandLine.Minimal.SourceGenerator/Conventions/SymbolFormattingExtensions.cs
rename to src/MinimalCli.SourceGenerator/Conventions/SymbolFormattingExtensions.cs
index 6ef270f..1c8c2cd 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/Conventions/SymbolFormattingExtensions.cs
+++ b/src/MinimalCli.SourceGenerator/Conventions/SymbolFormattingExtensions.cs
@@ -2,7 +2,7 @@
using System.Linq;
using System.Text.RegularExpressions;
-namespace System.CommandLine.Minimal.SourceGeneration.Conventions;
+namespace MinimalCli.SourceGeneration.Conventions;
internal static class SymbolFormattingExtensions
{
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/DiagnosticErrors.cs b/src/MinimalCli.SourceGenerator/DiagnosticErrors.cs
similarity index 96%
rename from src/System.CommandLine.Minimal.SourceGenerator/DiagnosticErrors.cs
rename to src/MinimalCli.SourceGenerator/DiagnosticErrors.cs
index feb1d27..055ce80 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/DiagnosticErrors.cs
+++ b/src/MinimalCli.SourceGenerator/DiagnosticErrors.cs
@@ -1,6 +1,6 @@
using Microsoft.CodeAnalysis;
-namespace System.CommandLine.Minimal.SourceGenerator
+namespace MinimalCli.SourceGenerator
{
internal static class DiagnosticErrors
{
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/GeneratorBindingsProvider.cs b/src/MinimalCli.SourceGenerator/GeneratorBindingsProvider.cs
similarity index 95%
rename from src/System.CommandLine.Minimal.SourceGenerator/GeneratorBindingsProvider.cs
rename to src/MinimalCli.SourceGenerator/GeneratorBindingsProvider.cs
index 6dc9fd1..fbabc90 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/GeneratorBindingsProvider.cs
+++ b/src/MinimalCli.SourceGenerator/GeneratorBindingsProvider.cs
@@ -2,11 +2,11 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Collections.Generic;
using System.Collections.Immutable;
-using System.CommandLine.Minimal.SourceGeneration.Conventions;
+using MinimalCli.SourceGeneration.Conventions;
using System.Linq;
using System.Threading;
-namespace System.CommandLine.Minimal.SourceGeneration;
+namespace MinimalCli.SourceGeneration;
internal enum BindingType { Argument, Option, DependencyInjection }
@@ -22,7 +22,7 @@ public static GeneratingCommandBinder Transform(GeneratorAttributeSyntaxContext
return null!;
AttributeData? handlerAttribute = ctx.Attributes.FirstOrDefault(a => a.AttributeClass is not null
- && a.AttributeClass.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == "global::System.CommandLine.Minimal.HandlerAttribute");
+ && a.AttributeClass.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == "global::MinimalCli.HandlerAttribute");
string? commandName = handlerAttribute?.ConstructorArguments.FirstOrDefault().Value as string;
Location? argumentLocation = null;
@@ -33,7 +33,7 @@ public static GeneratingCommandBinder Transform(GeneratorAttributeSyntaxContext
.FirstOrDefault(attr => ctx.SemanticModel
.GetTypeInfo(attr)
.Type?
- .ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == "global::System.CommandLine.Minimal.HandlerAttribute"
+ .ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == "global::MinimalCli.HandlerAttribute"
);
argumentLocation = handlerAttrSyntax?.ArgumentList?.Arguments.FirstOrDefault()?.GetLocation();
}
@@ -44,7 +44,7 @@ public static GeneratingCommandBinder Transform(GeneratorAttributeSyntaxContext
// .SelectMany(list => list.Attributes)
// .FirstOrDefault(attr =>
// ctx.SemanticModel.GetTypeInfo(attr).Type?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)
- // == "global::System.CommandLine.Minimal.HandlerAttribute"),
+ // == "global::MinimalCli.HandlerAttribute"),
// _ => null
//};
//Location? argumentLocation = handlerAttributeSyntax?.ArgumentList?.Arguments.FirstOrDefault()?.GetLocation();
@@ -67,11 +67,11 @@ public static GeneratingCommandBinder Transform(GeneratorAttributeSyntaxContext
string type = param.Type.ToDisplayString(NullableFlowState.None, SymbolDisplayFormat.FullyQualifiedFormat);
AttributeData? fromServicesAttribute = attributes.FirstOrDefault(a => a.AttributeClass
- ?.ToDisplayString() == "System.CommandLine.Minimal.FromServicesAttribute");
+ ?.ToDisplayString() == "MinimalCli.FromServicesAttribute");
AttributeData? optionAttribute = attributes.FirstOrDefault(a => a.AttributeClass
- ?.ToDisplayString() == "System.CommandLine.Minimal.OptionAttribute");
+ ?.ToDisplayString() == "MinimalCli.OptionAttribute");
AttributeData? argumentAttribute = attributes.FirstOrDefault(a => a.AttributeClass
- ?.ToDisplayString() == "System.CommandLine.Minimal.ArgumentAttribute");
+ ?.ToDisplayString() == "MinimalCli.ArgumentAttribute");
// check for attributes first, then try to bind anyways
// by convention if it has a default value it is an option, developer can override this with an [Argument] attribute
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/IsExternalInit.cs b/src/MinimalCli.SourceGenerator/IsExternalInit.cs
similarity index 100%
rename from src/System.CommandLine.Minimal.SourceGenerator/IsExternalInit.cs
rename to src/MinimalCli.SourceGenerator/IsExternalInit.cs
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/MapAllCommandsExtensionWriter.cs b/src/MinimalCli.SourceGenerator/MapAllCommandsExtensionWriter.cs
similarity index 92%
rename from src/System.CommandLine.Minimal.SourceGenerator/MapAllCommandsExtensionWriter.cs
rename to src/MinimalCli.SourceGenerator/MapAllCommandsExtensionWriter.cs
index 3883461..c298bb0 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/MapAllCommandsExtensionWriter.cs
+++ b/src/MinimalCli.SourceGenerator/MapAllCommandsExtensionWriter.cs
@@ -1,7 +1,7 @@
using System.Collections.Immutable;
using System.Text;
-namespace System.CommandLine.Minimal.SourceGeneration;
+namespace MinimalCli.SourceGeneration;
internal static class MapAllCommandsExtensionWriter
{
@@ -20,9 +20,9 @@ internal static class MapAllCommandsExtensionWriter
"""
using Microsoft.Extensions.DependencyInjection.Extensions;
using System.CommandLine;
- using System.CommandLine.Minimal;
+ using MinimalCli;
- namespace System.CommandLine.Minimal;
+ namespace MinimalCli;
public static class MapAllCommandsExtension
{
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/System.CommandLine.Minimal.SourceGenerator.csproj b/src/MinimalCli.SourceGenerator/MinimalCli.SourceGenerator.csproj
similarity index 92%
rename from src/System.CommandLine.Minimal.SourceGenerator/System.CommandLine.Minimal.SourceGenerator.csproj
rename to src/MinimalCli.SourceGenerator/MinimalCli.SourceGenerator.csproj
index 5d054d3..3892eae 100644
--- a/src/System.CommandLine.Minimal.SourceGenerator/System.CommandLine.Minimal.SourceGenerator.csproj
+++ b/src/MinimalCli.SourceGenerator/MinimalCli.SourceGenerator.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/MinimalCli.SourceGenerator/MinimalCommandLine.SourceGenerator.targets b/src/MinimalCli.SourceGenerator/MinimalCommandLine.SourceGenerator.targets
new file mode 100644
index 0000000..04479d2
--- /dev/null
+++ b/src/MinimalCli.SourceGenerator/MinimalCommandLine.SourceGenerator.targets
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/Properties/launchSettings.json b/src/MinimalCli.SourceGenerator/Properties/launchSettings.json
similarity index 100%
rename from src/System.CommandLine.Minimal.SourceGenerator/Properties/launchSettings.json
rename to src/MinimalCli.SourceGenerator/Properties/launchSettings.json
diff --git a/src/MinimalCli.SourceGenerator/_Imports.cs b/src/MinimalCli.SourceGenerator/_Imports.cs
new file mode 100644
index 0000000..76d1fbe
--- /dev/null
+++ b/src/MinimalCli.SourceGenerator/_Imports.cs
@@ -0,0 +1 @@
+global using System;
\ No newline at end of file
diff --git a/src/System.CommandLine.Minimal.sln b/src/MinimalCli.sln
similarity index 82%
rename from src/System.CommandLine.Minimal.sln
rename to src/MinimalCli.sln
index a4a3129..279cdd5 100644
--- a/src/System.CommandLine.Minimal.sln
+++ b/src/MinimalCli.sln
@@ -5,7 +5,7 @@ VisualStudioVersion = 17.3.32804.467
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoApp", "DemoApp\DemoApp.csproj", "{C10C4313-AF8A-437C-825F-A7733F288DEE}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.Minimal", "System.CommandLine.Minimal\System.CommandLine.Minimal.csproj", "{2227CB1E-60FF-47C1-82E3-67A348F614AE}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MinimalCli", "MinimalCli\MinimalCli.csproj", "{2227CB1E-60FF-47C1-82E3-67A348F614AE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{14529171-0525-4EF0-B11E-40129813AD44}"
ProjectSection(SolutionItems) = preProject
@@ -16,9 +16,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "HelloWorld\HelloWorld.csproj", "{B20E4694-01C6-4866-966D-56961B159961}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.CommandLine.Minimal.Core", "System.CommandLine.Minimal.Core\System.CommandLine.Minimal.Core.csproj", "{86A9F343-6ACE-4291-8016-A8B242FCAFDA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalCli.Core", "MinimalCli.Core\MinimalCli.Core.csproj", "{86A9F343-6ACE-4291-8016-A8B242FCAFDA}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.CommandLine.Minimal.SourceGenerator", "System.CommandLine.Minimal.SourceGenerator\System.CommandLine.Minimal.SourceGenerator.csproj", "{5AF84270-8ECB-4097-A8DA-9C676E1E9373}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalCli.SourceGenerator", "MinimalCli.SourceGenerator\MinimalCli.SourceGenerator.csproj", "{5AF84270-8ECB-4097-A8DA-9C676E1E9373}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/System.CommandLine.Minimal/System.CommandLine.Minimal.csproj b/src/MinimalCli/MinimalCli.csproj
similarity index 79%
rename from src/System.CommandLine.Minimal/System.CommandLine.Minimal.csproj
rename to src/MinimalCli/MinimalCli.csproj
index f687e9e..a62f981 100644
--- a/src/System.CommandLine.Minimal/System.CommandLine.Minimal.csproj
+++ b/src/MinimalCli/MinimalCli.csproj
@@ -26,10 +26,10 @@
-
+
-
+
diff --git a/src/System.CommandLine.Minimal.SourceGenerator/MinimalCommandLine.SourceGenerator.targets b/src/System.CommandLine.Minimal.SourceGenerator/MinimalCommandLine.SourceGenerator.targets
deleted file mode 100644
index 2e76411..0000000
--- a/src/System.CommandLine.Minimal.SourceGenerator/MinimalCommandLine.SourceGenerator.targets
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file