Browse Source

Add embedded help.

tags/v0.2
Starbeamrainbowlabs 3 years ago
parent
commit
e03b1c5426
4 changed files with 29 additions and 0 deletions
  1. 2
    0
      README.md
  2. 9
    0
      cscz/Help.md
  3. 15
    0
      cscz/Program.cs
  4. 3
    0
      cscz/cscz.csproj

+ 2
- 0
README.md View File

@@ -26,3 +26,5 @@ Vector3 position
```

See the [Changelog](https://git.starbeamrainbowlabs.com/sbrl/cscz/src/master/Changelog.md) for a summary of what's changed between releases.

Type `./cscz.exe --help` for usage information or see Help.md in the project folder.

+ 9
- 0
cscz/Help.md View File

@@ -0,0 +1,9 @@
cscz - The C# Class Generator

Usage:
cat filename | ./cscz

Examples:
cat MyDef.cscz | ./cscz

tee | ./cscz >Carrot.cs

+ 15
- 0
cscz/Program.cs View File

@@ -1,6 +1,8 @@
using System;
using System.Text;
using System.Diagnostics;
using System.Reflection;
using System.IO;

namespace cscz
{
@@ -8,6 +10,19 @@ namespace cscz
{
public static void Main(string[] args)
{
if(args.Length >= 1 && args[0] == "--help")
{
Assembly asm = Assembly.GetExecutingAssembly();
/*** Debug - Lists the names of all embedded resources ***
foreach(string str in asm.GetManifestResourceNames())
Console.WriteLine(str);*/
StreamReader helpTextReader = new StreamReader(asm.GetManifestResourceStream(@"cscz.Help.md"));
string helpText = helpTextReader.ReadToEnd();
helpTextReader.Dispose();
Console.WriteLine(helpText);
return;
}

ClassGenerator cg = new ClassGenerator();
/*
cg.Signatures.Add("float radius");

+ 3
- 0
cscz/cscz.csproj View File

@@ -43,4 +43,7 @@
<Compile Include="ClassGenerator.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<EmbeddedResource Include="Help.md" />
</ItemGroup>
</Project>

Loading…
Cancel
Save