Skip to content

Commit

Permalink
Merge pull request #6 from ibigbug/fix-crash
Browse files Browse the repository at this point in the history
fix help crash issue
  • Loading branch information
ibigbug committed Nov 12, 2019
2 parents 7bb17e6 + d895fe1 commit 49373d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion PowerSession.Cli/PowerSession.Cli.csproj
Expand Up @@ -17,7 +17,8 @@
</ItemGroup>

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

</Project>
12 changes: 8 additions & 4 deletions PowerSession.Cli/Program.cs
Expand Up @@ -13,12 +13,13 @@ private static void Main(string[] args)
{
var record = new Command("rec")
{
new Argument<FileInfo>("file"),
new Argument<FileInfo>("file"){Description = "The filename to save the record"},
new Option(new []{"--command", "-c"}, "The command to record, default to be powershell.exe")
{
Argument = new Argument<string>()
}
};
record.Description = "Record and save a session";
record.Handler = CommandHandler.Create((FileInfo file, string command) =>
{
var recordCmd = new RecordCommand(new RecordArgs
Expand All @@ -32,8 +33,9 @@ private static void Main(string[] args)

var play = new Command("play")
{
new Argument<FileInfo>("file")
new Argument<FileInfo>("file"){Description = "The record session"}
};
play.Description = "Play a recorded session";
play.Handler = CommandHandler.Create((FileInfo file) =>
{
var playCommand = new PlayCommand(new PlayArgs{Filename = file.FullName, EnableAnsiEscape = true});
Expand All @@ -46,13 +48,15 @@ private static void Main(string[] args)
{
var authCommand = new AuthCommand();
authCommand.Execute();
})
}),
Description = "Auth with asciinema.org"
};

var upload = new Command("upload")
{
new Argument<FileInfo>("file")
new Argument<FileInfo>("file"){Description = "The file to be uploaded"}
};
upload.Description = "Upload a session to ascinema.org";
upload.Handler = CommandHandler.Create((FileInfo file) =>
{
var uploadCommand = new UploadCommand(file.FullName);
Expand Down
9 changes: 9 additions & 0 deletions PowerSession.Cli/nuget.config
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="dotnetcore" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
</packageSources>
</configuration>

0 comments on commit 49373d4

Please sign in to comment.