Skip to content

Commit 49373d4

Browse files
authored
Merge pull request #6 from ibigbug/fix-crash
fix help crash issue
2 parents 7bb17e6 + d895fe1 commit 49373d4

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

PowerSession.Cli/PowerSession.Cli.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="System.CommandLine.Experimental" Version="0.3.0-alpha.19405.1" />
20+
<PackageReference Include="Microsoft.Packaging.Tools.Trimming" Version="1.1.0-preview1-26619-01" />
21+
<PackageReference Include="System.CommandLine.Experimental" Version="0.3.0-alpha.19528.1" />
2122
</ItemGroup>
2223

2324
</Project>

PowerSession.Cli/Program.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ private static void Main(string[] args)
1313
{
1414
var record = new Command("rec")
1515
{
16-
new Argument<FileInfo>("file"),
16+
new Argument<FileInfo>("file"){Description = "The filename to save the record"},
1717
new Option(new []{"--command", "-c"}, "The command to record, default to be powershell.exe")
1818
{
1919
Argument = new Argument<string>()
2020
}
2121
};
22+
record.Description = "Record and save a session";
2223
record.Handler = CommandHandler.Create((FileInfo file, string command) =>
2324
{
2425
var recordCmd = new RecordCommand(new RecordArgs
@@ -32,8 +33,9 @@ private static void Main(string[] args)
3233

3334
var play = new Command("play")
3435
{
35-
new Argument<FileInfo>("file")
36+
new Argument<FileInfo>("file"){Description = "The record session"}
3637
};
38+
play.Description = "Play a recorded session";
3739
play.Handler = CommandHandler.Create((FileInfo file) =>
3840
{
3941
var playCommand = new PlayCommand(new PlayArgs{Filename = file.FullName, EnableAnsiEscape = true});
@@ -46,13 +48,15 @@ private static void Main(string[] args)
4648
{
4749
var authCommand = new AuthCommand();
4850
authCommand.Execute();
49-
})
51+
}),
52+
Description = "Auth with asciinema.org"
5053
};
5154

5255
var upload = new Command("upload")
5356
{
54-
new Argument<FileInfo>("file")
57+
new Argument<FileInfo>("file"){Description = "The file to be uploaded"}
5558
};
59+
upload.Description = "Upload a session to ascinema.org";
5660
upload.Handler = CommandHandler.Create((FileInfo file) =>
5761
{
5862
var uploadCommand = new UploadCommand(file.FullName);

PowerSession.Cli/nuget.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
5+
<clear />
6+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
7+
<add key="dotnetcore" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
8+
</packageSources>
9+
</configuration>

0 commit comments

Comments
 (0)