-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Added GenerateSettings to bypass limit in cli.
- Loading branch information
Showing
3 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using AutoSDK.Naming.Methods; | ||
|
||
namespace AutoSDK.CLI.Commands; | ||
|
||
public class GenerateSettings | ||
{ | ||
public required string Input { get; set; } | ||
public required string Output { get; set; } | ||
public required string TargetFramework { get; set; } | ||
public required string Namespace { get; set; } | ||
public required string ClientClassName { get; set; } | ||
public required MethodNamingConvention MethodNamingConvention { get; set; } | ||
public required bool SingleFile { get; set; } | ||
public required bool ExcludeDeprecatedOperations { get; set; } | ||
public required string ClsCompliantEnumPrefix { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.CommandLine; | ||
using System.CommandLine.Binding; | ||
using AutoSDK.Naming.Methods; | ||
|
||
namespace AutoSDK.CLI.Commands; | ||
|
||
public class GenerateSettingsBinder( | ||
Argument<string> input, | ||
Option<string> output, | ||
Option<string> targetFramework, | ||
Option<string> @namespace, | ||
Option<string> clientClassName, | ||
Option<MethodNamingConvention> methodNamingConvention, | ||
Option<bool> singleFile, | ||
Option<bool> excludeDeprecatedOperations, | ||
Option<string> clsCompliantEnumPrefix | ||
) | ||
: BinderBase<GenerateSettings> | ||
{ | ||
protected override GenerateSettings GetBoundValue(BindingContext bindingContext) | ||
{ | ||
bindingContext = bindingContext ?? throw new ArgumentNullException(nameof(bindingContext)); | ||
|
||
return new GenerateSettings | ||
{ | ||
Input = bindingContext.ParseResult.GetValueForArgument(input), | ||
Output = bindingContext.ParseResult.GetValueForOption(output)!, | ||
TargetFramework = bindingContext.ParseResult.GetValueForOption(targetFramework)!, | ||
Namespace = bindingContext.ParseResult.GetValueForOption(@namespace)!, | ||
ClientClassName = bindingContext.ParseResult.GetValueForOption(clientClassName)!, | ||
MethodNamingConvention = bindingContext.ParseResult.GetValueForOption(methodNamingConvention), | ||
SingleFile = bindingContext.ParseResult.GetValueForOption(singleFile), | ||
ExcludeDeprecatedOperations = bindingContext.ParseResult.GetValueForOption(excludeDeprecatedOperations), | ||
ClsCompliantEnumPrefix = bindingContext.ParseResult.GetValueForOption(clsCompliantEnumPrefix)!, | ||
}; | ||
} | ||
} |