Skip to content

Commit 25763e2

Browse files
author
Viktor Chernev
committed
Adding cmd functionality
1 parent 65c0e61 commit 25763e2

File tree

10 files changed

+931
-168
lines changed

10 files changed

+931
-168
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace DescribeCompiler.Compiler
8+
{
9+
/// <summary>
10+
/// Indicates how to use artifacts
11+
/// </summary>
12+
public enum ArtifactMode
13+
{
14+
MakeOnly,
15+
TakeOnly,
16+
Use,
17+
No
18+
}
19+
}

@DescribeCompilerAPI/DescribeCompilerAPI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<Compile Include="Compiler\DescribeCompiler#Statistics.cs" />
6060
<Compile Include="Compiler\DescribeCompiler#Settings.cs" />
6161
<Compile Include="Compiler\DescribeCompiler.cs" />
62+
<Compile Include="Compiler\eArtifactMode.cs" />
6263
<Compile Include="Compiler\Optimizers\IDescribeOptimizer.cs" />
6364
<Compile Include="Translators\CharacterDictionaries.cs" />
6465
<Compile Include="Translators\JsonTranslator.cs" />

@DescribeCompilerCLI/Datnik.cs

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using DescribeCompiler;
2+
using DescribeCompiler.Compiler;
23
using System;
34
using System.Collections.Generic;
45
using System.Linq;
@@ -9,6 +10,13 @@ namespace DescribeCompilerCLI
910
{
1011
internal class Datnik
1112
{
13+
/// <summary>
14+
/// The output directory for the ext and extone commands
15+
/// </summary>
16+
public static string extOutputDir;
17+
18+
19+
1220
/// <summary>
1321
/// The input file or folder
1422
/// </summary>
@@ -29,40 +37,96 @@ internal class Datnik
2937
/// </summary>
3038
public static bool isOutputDir;
3139

40+
/// <summary>
41+
/// When parsing a folder, weather to parse files in top directory only
42+
/// or parse files in child directories as well
43+
/// </summary>
44+
public static bool topOnly;
45+
46+
/// <summary>
47+
/// Weather to omit files that are not Describe source files (".DS")
48+
/// </summary>
49+
public static bool dsOnly;
50+
51+
52+
3253
/// <summary>
3354
/// The verbosity for the parser
3455
/// </summary>
3556
public static LogVerbosity verbosity;
3657

3758
/// <summary>
38-
/// The template for the parser
59+
/// Weather the compiler should stop after encountering an error
60+
/// or add the file to the list of failed files and continue with
61+
/// the next one
62+
/// </summary>
63+
public static bool requireSuccess;
64+
65+
66+
67+
/// <summary>
68+
/// The name of the template for the parser
3969
/// </summary>
4070
public static string templateName;
4171

72+
/// <summary>
73+
/// The path of the template for the parser
74+
/// </summary>
75+
public static string templatePath;
4276

77+
/// <summary>
78+
/// Weather the template set is internal or external
79+
/// </summary>
80+
public static bool isInternal;
81+
82+
83+
84+
/// <summary>
85+
/// Path to an external log file
86+
/// </summary>
87+
public static string logFilePath;
88+
89+
/// <summary>
90+
/// Weather to output logs to an external file
91+
/// </summary>
92+
public static bool logToFile;
4393

44-
////new
45-
///// <summary>
46-
///// Wether the compiler should stop after encountering an error
47-
///// or add the file to the list of failed files and continue with
48-
///// the next one.
49-
///// </summary>
50-
//public static bool requireSuccess;
94+
95+
96+
/// <summary>
97+
/// Weather to and how to use artifacts
98+
/// </summary>
99+
public static ArtifactMode artifactMode;
100+
101+
/// <summary>
102+
/// Path to artifacts folder
103+
/// </summary>
104+
public static string artifactsFolderPath;
51105

52106

53107
static Datnik()
54108
{
55-
input = "";
56-
output = "";
109+
extOutputDir = null;
57110

111+
input = null;
112+
output = null;
58113
isInputDir = false;
59114
isOutputDir = false;
115+
topOnly = false;
116+
117+
templateName = "HTML_PARACORD";
118+
templatePath = null;
119+
isInternal = true;
120+
121+
logFilePath = null;
122+
logToFile = false;
60123

124+
dsOnly = true;
61125
verbosity = LogVerbosity.Low;
62-
templateName = null;
126+
requireSuccess = true;
63127

64-
//new
65-
//requireSuccess = false;
128+
artifactMode = ArtifactMode.No;
129+
artifactsFolderPath = null;
66130
}
67131
}
68132
}

@DescribeCompilerCLI/DescribeCompilerCLI.csproj.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
4-
<StartArguments>"C:\Users\Viktor Chernev\Desktop\Language\DataLists\Lists" template=JSON_COMMONER "C:\Users\Viktor Chernev\Desktop\data.json"</StartArguments>
4+
<StartArguments>-h</StartArguments>
55
</PropertyGroup>
66
<PropertyGroup>
77
<PublishUrlHistory>C:\Users\Viktor Chernev\Desktop\DescribeParser\%40CompilerCLI\Release\|publish\</PublishUrlHistory>

0 commit comments

Comments
 (0)