diff options
Diffstat (limited to 'src/WixToolset.Core/CommandLine/CommandLine.cs')
-rw-r--r-- | src/WixToolset.Core/CommandLine/CommandLine.cs | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/src/WixToolset.Core/CommandLine/CommandLine.cs b/src/WixToolset.Core/CommandLine/CommandLine.cs index 79f5d5bc..744e05b8 100644 --- a/src/WixToolset.Core/CommandLine/CommandLine.cs +++ b/src/WixToolset.Core/CommandLine/CommandLine.cs | |||
@@ -54,35 +54,6 @@ namespace WixToolset.Core.CommandLine | |||
54 | } | 54 | } |
55 | 55 | ||
56 | return command; | 56 | return command; |
57 | //switch (commandType) | ||
58 | //{ | ||
59 | //case CommandTypes.Build: | ||
60 | //{ | ||
61 | // var sourceFiles = GatherSourceFiles(files, outputFolder); | ||
62 | // var variables = this.GatherPreprocessorVariables(defines); | ||
63 | // var bindPathList = this.GatherBindPaths(bindPaths); | ||
64 | // var filterCultures = CalculateFilterCultures(cultures); | ||
65 | // var type = CalculateOutputType(outputType, outputFile); | ||
66 | // var platform = CalculatePlatform(platformType); | ||
67 | // return new BuildCommand(this.ServiceProvider, sourceFiles, variables, locFiles, libraryFiles, filterCultures, outputFile, type, platform, cabCachePath, bindFiles, bindPathList, includePaths, intermediateFolder, contentsFile, outputsFile, builtOutputsFile); | ||
68 | //} | ||
69 | |||
70 | //case CommandTypes.Compile: | ||
71 | //{ | ||
72 | // var sourceFiles = GatherSourceFiles(files, outputFolder); | ||
73 | // var variables = this.GatherPreprocessorVariables(defines); | ||
74 | // var platform = CalculatePlatform(platformType); | ||
75 | // return new CompileCommand(this.ServiceProvider, sourceFiles, variables, platform); | ||
76 | //} | ||
77 | |||
78 | //case CommandTypes.Decompile: | ||
79 | //{ | ||
80 | // var sourceFiles = GatherSourceFiles(files, outputFolder); | ||
81 | // return new DecompileCommand(this.ServiceProvider, sourceFiles, outputFile); | ||
82 | //} | ||
83 | //} | ||
84 | |||
85 | //return null; | ||
86 | } | 57 | } |
87 | 58 | ||
88 | private ICommandLineCommand Parse(ICommandLineContext context) | 59 | private ICommandLineCommand Parse(ICommandLineContext context) |
@@ -109,7 +80,7 @@ namespace WixToolset.Core.CommandLine | |||
109 | // First argument must be the command or global switch (that creates a command). | 80 | // First argument must be the command or global switch (that creates a command). |
110 | if (command == null) | 81 | if (command == null) |
111 | { | 82 | { |
112 | if (!this.TryParseUnknownCommandArg(arg, parser, out command, extensions)) | 83 | if (!this.TryParseCommand(arg, parser, out command, extensions)) |
113 | { | 84 | { |
114 | parser.ErrorArgument = arg; | 85 | parser.ErrorArgument = arg; |
115 | } | 86 | } |
@@ -121,7 +92,7 @@ namespace WixToolset.Core.CommandLine | |||
121 | parser.ErrorArgument = arg; | 92 | parser.ErrorArgument = arg; |
122 | } | 93 | } |
123 | } | 94 | } |
124 | else if (!TryParseCommandLineArgumentWithExtension(arg, parser, extensions) && command?.TryParseArgument(parser, arg) == false) | 95 | else if (!TryParseCommandLineArgumentWithExtension(arg, parser, extensions) && !command.TryParseArgument(parser, arg)) |
125 | { | 96 | { |
126 | parser.ErrorArgument = arg; | 97 | parser.ErrorArgument = arg; |
127 | } | 98 | } |
@@ -135,7 +106,7 @@ namespace WixToolset.Core.CommandLine | |||
135 | return command ?? new HelpCommand(); | 106 | return command ?? new HelpCommand(); |
136 | } | 107 | } |
137 | 108 | ||
138 | private bool TryParseUnknownCommandArg(string arg, ICommandLineParser parser, out ICommandLineCommand command, IEnumerable<IExtensionCommandLine> extensions) | 109 | private bool TryParseCommand(string arg, ICommandLineParser parser, out ICommandLineCommand command, IEnumerable<IExtensionCommandLine> extensions) |
139 | { | 110 | { |
140 | command = null; | 111 | command = null; |
141 | 112 | ||
@@ -147,6 +118,7 @@ namespace WixToolset.Core.CommandLine | |||
147 | case "?": | 118 | case "?": |
148 | case "h": | 119 | case "h": |
149 | case "help": | 120 | case "help": |
121 | case "-help": | ||
150 | command = new HelpCommand(); | 122 | command = new HelpCommand(); |
151 | break; | 123 | break; |
152 | 124 | ||
@@ -179,7 +151,7 @@ namespace WixToolset.Core.CommandLine | |||
179 | { | 151 | { |
180 | foreach (var extension in extensions) | 152 | foreach (var extension in extensions) |
181 | { | 153 | { |
182 | if (extension.TryParseCommand(parser, out command)) | 154 | if (extension.TryParseCommand(parser, arg, out command)) |
183 | { | 155 | { |
184 | break; | 156 | break; |
185 | } | 157 | } |