public bool TryParseArgument(IParseCommandLine parseCommandLine, string arg) { if (parseCommandLine.IsSwitch(arg) && arg.Substring(1).Equals("example", StringComparison.OrdinalIgnoreCase)) { parseCommandLine.GetNextArgumentOrError(ref this.exampleValueFromCommandLine); return(true); } return(false); }
private string[] ParsePostExtensions(IParseCommandLine parser, string[] remaining) { var unprocessed = new List <string>(); for (int i = 0; i < remaining.Length; ++i) { var arg = remaining[i]; if (parser.IsSwitch(arg)) { unprocessed.Add(arg); } else { parser.GetArgumentAsFilePathOrError(arg, "source files", this.Files); } } if (0 == this.Files.Count) { this.ShowHelp = true; } else if (String.IsNullOrEmpty(this.OutputFile)) { if (1 < this.Files.Count) { this.Messaging.Write(ErrorMessages.MustSpecifyOutputWithMoreThanOneInput()); } // After the linker tells us what the output type actually is, we'll change the ".wix" to the correct extension. this.OutputFile = Path.ChangeExtension(Path.GetFileName(this.Files[0]), ".wix"); // Add the directories of the input files as unnamed bind paths. foreach (string file in this.Files) { var bindPath = new BindPath(Path.GetDirectoryName(Path.GetFullPath(file))); this.BindPaths.Add(bindPath); } } if (!this.SuppressWixPdb && String.IsNullOrEmpty(this.PdbFile) && !String.IsNullOrEmpty(this.OutputFile)) { this.PdbFile = Path.ChangeExtension(this.OutputFile, ".wixpdb"); } return(unprocessed.ToArray()); }