PasteArguments.Unix.cs 1012 B

12345678910111213141516171819202122232425262728
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Collections.Generic;
  5. using System.Runtime.CompilerServices;
  6. using System.Text;
  7. namespace System
  8. {
  9. internal static partial class PasteArguments
  10. {
  11. /// <summary>
  12. /// Repastes a set of arguments into a linear string that parses back into the originals under pre- or post-2008 VC parsing rules.
  13. /// On Unix: the rules for parsing the executable name (argv[0]) are ignored.
  14. /// </summary>
  15. internal static string Paste(IEnumerable<string> arguments, bool pasteFirstArgumentUsingArgV0Rules)
  16. {
  17. var stringBuilder = new StringBuilder();
  18. foreach (string argument in arguments)
  19. {
  20. AppendArgument(stringBuilder, argument);
  21. }
  22. return stringBuilder.ToString();
  23. }
  24. }
  25. }