forked from FacilityApi/FacilityJavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFsdGenJavaScriptApp.cs
More file actions
40 lines (35 loc) · 1.15 KB
/
Copy pathFsdGenJavaScriptApp.cs
File metadata and controls
40 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using ArgsReading;
using Facility.CodeGen.Console;
using Facility.CodeGen.JavaScript;
using Facility.Definition.CodeGen;
namespace fsdgenjs
{
public sealed class FsdGenJavaScriptApp : CodeGeneratorApp
{
public static int Main(string[] args) => new FsdGenJavaScriptApp().Run(args);
protected override IReadOnlyList<string> Description => new[]
{
"Generates a JavaScript client for a Facility Service Definition.",
};
protected override IReadOnlyList<string> ExtraUsage => new[]
{
" --module <name>",
" The module name used by the generated JavaScript.",
" --typescript",
" Generates TypeScript.",
" --express",
" Generates Express service.",
" --disable-eslint",
" Disables ESLint via code comment.",
};
protected override CodeGenerator CreateGenerator() => new JavaScriptGenerator();
protected override FileGeneratorSettings CreateSettings(ArgsReader args) =>
new JavaScriptGeneratorSettings
{
ModuleName = args.ReadOption("module"),
TypeScript = args.ReadFlag("typescript"),
Express = args.ReadFlag("express"),
DisableESLint = args.ReadFlag("disable-eslint"),
};
}
}