Skip to content

Commit

Permalink
add output type option
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed Dec 19, 2023
1 parent 90707df commit 864290c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/GUI/efcpt.7/Options/OutputType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ErikEJ.EFCorePowerTools;

public enum OutputType
{
Csharp,
Diagram,
}
6 changes: 6 additions & 0 deletions src/GUI/efcpt.7/Options/ScaffoldOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ internal sealed class ScaffoldOptions
HelpText = $"Full pathname to the {Constants.ConfigFileName} file, default is '{Constants.ConfigFileName}' in currrent directory")]
public FileInfo ConfigFile { get; set; }

[Option(
't',
"type",
HelpText = "Type of output, defaults to C# code, can be 'csharp' or 'diagram'")]
public OutputType Type { get; set; }

public bool IsDacpac => ConnectionString?.EndsWith(".dacpac", StringComparison.OrdinalIgnoreCase) ?? false;
}
#pragma warning restore CA1812 // Avoid uninstantiated internal classes
6 changes: 5 additions & 1 deletion src/GUI/efcpt.7/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public static async Task<int> Main(string[] args)

public static async Task<int> MainAsync(string[] args)
{
using var parser = new Parser(c => c.HelpWriter = null);
using var parser = new Parser(c =>
{
c.HelpWriter = null;
c.CaseInsensitiveEnumValues = true;
});

var parserResult = parser.ParseArguments<ScaffoldOptions>(args);

Expand Down

0 comments on commit 864290c

Please sign in to comment.