aboutsummaryrefslogtreecommitdiff
path: root/ErrorResponseCodeGenerator
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-02 22:52:33 +0800
committercrupest <crupest@outlook.com>2020-02-02 22:52:33 +0800
commitbcf15408ca1a1a16ccaca959861e812e6b24a33d (patch)
tree9a0a539cdaf50a8f35bfbcf65197fce26634feb1 /ErrorResponseCodeGenerator
parent12f85448cde94d70d9030b757b09caa5e2f53061 (diff)
downloadtimeline-bcf15408ca1a1a16ccaca959861e812e6b24a33d.tar.gz
timeline-bcf15408ca1a1a16ccaca959861e812e6b24a33d.tar.bz2
timeline-bcf15408ca1a1a16ccaca959861e812e6b24a33d.zip
Add copy to clipboard function to code generator.
Diffstat (limited to 'ErrorResponseCodeGenerator')
-rw-r--r--ErrorResponseCodeGenerator/ErrorResponseCodeGenerator.csproj4
-rw-r--r--ErrorResponseCodeGenerator/Program.cs6
2 files changed, 10 insertions, 0 deletions
diff --git a/ErrorResponseCodeGenerator/ErrorResponseCodeGenerator.csproj b/ErrorResponseCodeGenerator/ErrorResponseCodeGenerator.csproj
index e77a1ba3..8524b2e4 100644
--- a/ErrorResponseCodeGenerator/ErrorResponseCodeGenerator.csproj
+++ b/ErrorResponseCodeGenerator/ErrorResponseCodeGenerator.csproj
@@ -6,6 +6,10 @@
</PropertyGroup>
<ItemGroup>
+ <PackageReference Include="TextCopy" Version="3.0.0" />
+ </ItemGroup>
+
+ <ItemGroup>
<ProjectReference Include="..\Timeline.ErrorCodes\Timeline.ErrorCodes.csproj" />
</ItemGroup>
diff --git a/ErrorResponseCodeGenerator/Program.cs b/ErrorResponseCodeGenerator/Program.cs
index cf021927..5ea8aaca 100644
--- a/ErrorResponseCodeGenerator/Program.cs
+++ b/ErrorResponseCodeGenerator/Program.cs
@@ -57,6 +57,12 @@ $
".Replace("$", code);
Console.WriteLine(code);
+
+ TextCopy.Clipboard.SetText(code);
+ var oldColor = Console.ForegroundColor;
+ Console.ForegroundColor = ConsoleColor.Green;
+ Console.WriteLine("Code has copied to clipboard!");
+ Console.ForegroundColor = oldColor;
}
}
}