aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/CommandLine/DecompileCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-06-08 16:25:38 -0700
committerRob Mensching <rob@firegiant.com>2020-06-08 16:37:14 -0700
commit04b8976ca565ce95cf32a58c8725843618724383 (patch)
tree72cf07a394f193a49afcba9bac89647e3b0a0922 /src/WixToolset.Core/CommandLine/DecompileCommand.cs
parent3fb889ab7aa3cb0dfae23e0379e28552e919ad72 (diff)
downloadwix-04b8976ca565ce95cf32a58c8725843618724383.tar.gz
wix-04b8976ca565ce95cf32a58c8725843618724383.tar.bz2
wix-04b8976ca565ce95cf32a58c8725843618724383.zip
Make commands async and internal processes cancelable
Diffstat (limited to 'src/WixToolset.Core/CommandLine/DecompileCommand.cs')
-rw-r--r--src/WixToolset.Core/CommandLine/DecompileCommand.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/WixToolset.Core/CommandLine/DecompileCommand.cs b/src/WixToolset.Core/CommandLine/DecompileCommand.cs
index 0e21a4f4..1e11ae52 100644
--- a/src/WixToolset.Core/CommandLine/DecompileCommand.cs
+++ b/src/WixToolset.Core/CommandLine/DecompileCommand.cs
@@ -4,6 +4,8 @@ namespace WixToolset.Core.CommandLine
4{ 4{
5 using System; 5 using System;
6 using System.IO; 6 using System.IO;
7 using System.Threading;
8 using System.Threading.Tasks;
7 using System.Xml.Linq; 9 using System.Xml.Linq;
8 using WixToolset.Data; 10 using WixToolset.Data;
9 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
@@ -29,12 +31,12 @@ namespace WixToolset.Core.CommandLine
29 31
30 public IMessaging Messaging { get; } 32 public IMessaging Messaging { get; }
31 33
32 public int Execute() 34 public Task<int> ExecuteAsync(CancellationToken _)
33 { 35 {
34 if (this.commandLine.ShowHelp) 36 if (this.commandLine.ShowHelp)
35 { 37 {
36 Console.WriteLine("TODO: Show decompile command help"); 38 Console.WriteLine("TODO: Show decompile command help");
37 return -1; 39 return Task.FromResult(-1);
38 } 40 }
39 41
40 var context = this.ServiceProvider.GetService<IDecompileContext>(); 42 var context = this.ServiceProvider.GetService<IDecompileContext>();
@@ -61,10 +63,10 @@ namespace WixToolset.Core.CommandLine
61 63
62 if (this.Messaging.EncounteredError) 64 if (this.Messaging.EncounteredError)
63 { 65 {
64 return 1; 66 return Task.FromResult(1);
65 } 67 }
66 68
67 return 0; 69 return Task.FromResult(0);
68 } 70 }
69 71
70 public bool TryParseArgument(ICommandLineParser parser, string argument) 72 public bool TryParseArgument(ICommandLineParser parser, string argument)