/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.testtools.codecoverage@1.2.6/Editor/CommandLineParser/CommandLineOptionSet.cs
49 строк
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using System; namespace UnityEditor.TestTools.CodeCoverage.CommandLineParser { internal class CommandLineOptionSet { readonly ICommandLineOption[] m_Options; public CommandLineOptionSet(params ICommandLineOption[] options) { m_Options = options; } public void Parse(string[] args) { var i = 0; while (i < args.Length) { var arg = args[i]; if (!arg.StartsWith("-")) { i++; continue; } string value = null; if (i + 1 < args.Length && !args[i + 1].StartsWith("-")) { value = args[i + 1]; i++; } ApplyValueToMatchingOptions(arg, value); i++; } } private void ApplyValueToMatchingOptions(string argName, string value) { foreach (var option in m_Options) { if ("-" + option.ArgName == argName) { option.ApplyValue(value); } } } } }