<Comment>//</Comment><br/>
<Comment>//  Arguments.swift</Comment><br/>
<Comment>//  SwiftFormat</Comment><br/>
<Comment>//</Comment><br/>
<Comment>//  Created by Nick Lockwood on 07/08/2018.</Comment><br/>
<Comment>//  Copyright © 2018 Nick Lockwood.</Comment><br/>
<Comment>//</Comment><br/>
<Comment>//  Distributed under the permissive MIT license</Comment><br/>
<Comment>//  Get the latest version from here:</Comment><br/>
<Comment>//</Comment><br/>
<Comment>//  https://github.com/nicklockwood/SwiftFormat</Comment><br/>
<Comment>//</Comment><br/>
<Comment>//  Permission is hereby granted, free of charge, to any person obtaining a copy</Comment><br/>
<Comment>//  of this software and associated documentation files (the "Software"), to deal</Comment><br/>
<Comment>//  in the Software without restriction, including without limitation the rights</Comment><br/>
<Comment>//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</Comment><br/>
<Comment>//  copies of the Software, and to permit persons to whom the Software is</Comment><br/>
<Comment>//  furnished to do so, subject to the following conditions:</Comment><br/>
<Comment>//</Comment><br/>
<Comment>//  The above copyright notice and this permission notice shall be included in all</Comment><br/>
<Comment>//  copies or substantial portions of the Software.</Comment><br/>
<Comment>//</Comment><br/>
<Comment>//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</Comment><br/>
<Comment>//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</Comment><br/>
<Comment>//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</Comment><br/>
<Comment>//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</Comment><br/>
<Comment>//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</Comment><br/>
<Comment>//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</Comment><br/>
<Comment>//  SOFTWARE.</Comment><br/>
<Comment>//</Comment><br/>
<Normal Text></Normal Text><br/>
<Keyword>import</Keyword><Normal Text> </Normal Text><Imports>Foundation</Imports><br/>
<Normal Text></Normal Text><br/>
<Keyword>extension</Keyword><Normal Text> Options </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>static</Keyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>maxArgumentNameLength</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>16</Decimal><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>init</Keyword><Symbol>(</Symbol><Normal Text>_ args</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>String</Normal Text><Symbol>:</Symbol><Normal Text> String</Normal Text><Symbol>],</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> directory</Normal Text><Symbol>:</Symbol><Normal Text> String</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        fileOptions </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> fileOptionsFor</Normal Text><Symbol>(</Symbol><Normal Text>args</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        formatOptions </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> formatOptionsFor</Normal Text><Symbol>(</Symbol><Normal Text>args</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lint</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> args</Normal Text><Symbol>.</Symbol><Normal Text>keys</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><String>"lint"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>self</Keyword><Symbol>.</Symbol><Normal Text>lint </Normal Text><Symbol>=</Symbol><Normal Text> lint</Normal Text><br/>
<Normal Text>        rules </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> rulesFor</Normal Text><Symbol>(</Symbol><Normal Text>args</Normal Text><Symbol>,</Symbol><Normal Text> lint</Normal Text><Symbol>:</Symbol><Normal Text> lint</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>mutating</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>addArguments</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>in</Variable><Normal Text> </Normal Text><Variable>directory</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>oldArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> argumentsFor</Normal Text><Symbol>(</Symbol><Keyword>self</Keyword><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>newArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> mergeArguments</Normal Text><Symbol>(</Symbol><Normal Text>args</Normal Text><Symbol>,</Symbol><Normal Text> into</Normal Text><Symbol>:</Symbol><Normal Text> oldArguments</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>newOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> Options</Normal Text><Symbol>(</Symbol><Normal Text>newArguments</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>fileInfo</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> formatOptions</Normal Text><Symbol>?.</Symbol><Normal Text>fileInfo </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            newOptions</Normal Text><Symbol>.</Symbol><Normal Text>formatOptions</Normal Text><Symbol>?.</Symbol><Normal Text>fileInfo </Normal Text><Symbol>=</Symbol><Normal Text> fileInfo</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>self</Keyword><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> newOptions</Normal Text><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse a space-delimited string into an array of command-line arguments</Comment><br/>
<Comment>// Replicates the behavior implemented by the console when parsing input</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>parseArguments</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>argumentString</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>ignoreComments</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Bool</Data Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> true</Normal Text><Symbol>)</Symbol><Normal Text> -> [</Normal Text><Function>String</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><String>""</String><Symbol>]</Symbol><Normal Text> </Normal Text><Comment>// Arguments always begin with script path</Comment><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>characters</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> String</Normal Text><Symbol>.</Symbol><Normal Text>UnicodeScalarView</Normal Text><Symbol>.</Symbol><Normal Text>SubSequence</Normal Text><Symbol>(</Symbol><Normal Text>argumentString</Normal Text><Symbol>.</Symbol><Normal Text>unicodeScalars</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>string</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>escaped</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>quoted</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>    loop</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>while</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>char</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> characters</Normal Text><Symbol>.</Symbol><Normal Text>popFirst</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>switch</ControlFlowKeyword><Normal Text> char </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"#"</String><Normal Text> </Normal Text><Keyword>where</Keyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>ignoreComments </Normal Text><Symbol>&&</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>escaped </Normal Text><Symbol>&&</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>quoted</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>break</ControlFlowKeyword><Normal Text> loop </Normal Text><Comment>// comment</Comment><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"</String><String Char>\\</String Char><String>"</String><Normal Text> </Normal Text><Keyword>where</Keyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>escaped</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            escaped </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"</String><String Char>\"</String Char><String>"</String><Normal Text> </Normal Text><Keyword>where</Keyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>escaped </Normal Text><Symbol>&&</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>quoted</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            quoted </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"</String><String Char>\"</String Char><String>"</String><Normal Text> </Normal Text><Keyword>where</Keyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>escaped </Normal Text><Symbol>&&</Symbol><Normal Text> quoted</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            quoted </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>fallthrough</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>" "</String><Normal Text> </Normal Text><Keyword>where</Keyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>escaped </Normal Text><Symbol>&&</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>quoted</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>string</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                arguments</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>string</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            string</Normal Text><Symbol>.</Symbol><Normal Text>removeAll</Normal Text><Symbol>()</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"</String><String Char>\"</String Char><String>"</String><Normal Text> </Normal Text><Keyword>where</Keyword><Normal Text> escaped</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            escaped </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>            string</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><String>"</String><String Char>\"</String Char><String>"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> _ </Normal Text><Keyword>where</Keyword><Normal Text> escaped </Normal Text><Symbol>&&</Symbol><Normal Text> quoted</Normal Text><Symbol>:</Symbol><br/>
<Normal Text>            string</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><String>"</String><String Char>\\</String Char><String>"</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>fallthrough</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><Keyword>default</Keyword><Symbol>:</Symbol><br/>
<Normal Text>            escaped </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>            string</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>Character</Normal Text><Symbol>(</Symbol><Normal Text>char</Normal Text><Symbol>))</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>string</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        arguments</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>string</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> arguments</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse a flat array of command-line arguments into a dictionary of flags and values</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>preprocessArguments</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>_</Variable><Normal Text> </Normal Text><Variable>names</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> [</Normal Text><Function>String</Function><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>anonymousArgs</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>0</Decimal><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>namedArgs</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>String</Normal Text><Symbol>:</Symbol><Normal Text> String</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[:]</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>name</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> arg </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> args </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> arg</Normal Text><Symbol>.</Symbol><Normal Text>hasPrefix</Normal Text><Symbol>(</Symbol><String>"--"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Comment>// Long argument names</Comment><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>key</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> String</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>.</Symbol><Normal Text>unicodeScalars</Normal Text><Symbol>.</Symbol><Normal Text>dropFirst</Normal Text><Symbol>(</Symbol><Decimal>2</Decimal><Symbol>))</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> names</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>key</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>match</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> bestMatches</Normal Text><Symbol>(</Symbol><ControlFlowKeyword>for</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> key</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> names</Normal Text><Symbol>).</Symbol><Normal Text>first </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                    </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unknown option --</String><Error>\(</Error><String>key)"</String><Symbol>)</Symbol><br/>
<Normal Text>                </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unknown option --</String><Error>\(</Error><String>key). Did you mean --</String><Error>\(</Error><String>match)?"</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            name </Normal Text><Symbol>=</Symbol><Normal Text> key</Normal Text><br/>
<Normal Text>            namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>??</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>continue</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> arg</Normal Text><Symbol>.</Symbol><Normal Text>hasPrefix</Normal Text><Symbol>(</Symbol><String>"-"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Comment>// Short argument names</Comment><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>flag</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> String</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>.</Symbol><Normal Text>unicodeScalars</Normal Text><Symbol>.</Symbol><Normal Text>dropFirst</Normal Text><Symbol>())</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>match</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> names</Normal Text><Symbol>.</Symbol><Normal Text>first</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>hasPrefix</Normal Text><Symbol>(</Symbol><Normal Text>flag</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>})</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unknown flag -</String><Error>\(</Error><String>flag)"</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            name </Normal Text><Symbol>=</Symbol><Normal Text> match</Normal Text><br/>
<Normal Text>            namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>??</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>continue</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> name </Normal Text><Symbol>==</Symbol><Normal Text> </Normal Text><String>""</String><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Comment>// Argument is anonymous</Comment><br/>
<Normal Text>            name </Normal Text><Symbol>=</Symbol><Normal Text> String</Normal Text><Symbol>(</Symbol><Normal Text>anonymousArgs</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            anonymousArgs </Normal Text><Symbol>+=</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arg</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> arg</Normal Text><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>hasTrailingComma</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> arg</Normal Text><Symbol>.</Symbol><Normal Text>hasSuffix</Normal Text><Symbol>(</Symbol><String>","</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>&&</Symbol><Normal Text> arg </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><String>","</String><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> hasTrailingComma </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            arg </Normal Text><Symbol>=</Symbol><Normal Text> String</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>.</Symbol><Normal Text>dropLast</Normal Text><Symbol>())</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>existing</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>],</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>existing</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>           </Normal Text><Comment>// </Comment><Alert Level 2>TODO</Alert Level 2><Comment>: find a more general way to represent merge-able options</Comment><br/>
<Normal Text>           </Normal Text><Symbol>[</Symbol><String>"exclude"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"unexclude"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"disable"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"enable"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"lintonly"</String><Symbol>,</Symbol><Normal Text> </Normal Text><String>"rules"</String><Symbol>].</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>name</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>||</Symbol><br/>
<Normal Text>           Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>               $</Normal Text><Float>0.</Float><Normal Text>argumentName </Normal Text><Symbol>==</Symbol><Normal Text> name </Normal Text><Symbol>&&</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>isSetType</Normal Text><br/>
<Normal Text>           </Normal Text><Symbol>})</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> existing </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><String>","</String><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> arg</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            namedArgs</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> arg</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>hasTrailingComma </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            name </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> namedArgs</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Find best match for a given string in a list of options</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>bestMatches</Function><Symbol>(</Symbol><Variable>for</Variable><Normal Text> </Normal Text><Variable>query</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>in</Variable><Normal Text> </Normal Text><Variable>options</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>)</Symbol><Normal Text> -> [</Normal Text><Function>String</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lowercaseQuery</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> query</Normal Text><Symbol>.</Symbol><Normal Text>lowercased</Normal Text><Symbol>()</Symbol><br/>
<Normal Text>    </Normal Text><Comment>// Sort matches by Levenshtein edit distance</Comment><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> options</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>compactMap </Normal Text><Symbol>{</Symbol><Normal Text> option </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>String</Normal Text><Symbol>,</Symbol><Normal Text> distance</Normal Text><Symbol>:</Symbol><Normal Text> Int</Normal Text><Symbol>,</Symbol><Normal Text> commonPrefix</Normal Text><Symbol>:</Symbol><Normal Text> Int</Normal Text><Symbol>)?</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lowercaseOption</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> option</Normal Text><Symbol>.</Symbol><Normal Text>lowercased</Normal Text><Symbol>()</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>distance</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> editDistance</Normal Text><Symbol>(</Symbol><Normal Text>lowercaseOption</Normal Text><Symbol>,</Symbol><Normal Text> lowercaseQuery</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>commonPrefix</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> lowercaseOption</Normal Text><Symbol>.</Symbol><Normal Text>commonPrefix</Normal Text><Symbol>(</Symbol><Normal Text>with</Normal Text><Symbol>:</Symbol><Normal Text> lowercaseQuery</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> commonPrefix</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty</Normal Text><Symbol>,</Symbol><Normal Text> distance </Normal Text><Symbol>></Symbol><Normal Text> lowercaseQuery</Normal Text><Symbol>.</Symbol><Normal Text>count </Normal Text><Symbol>/</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>option</Normal Text><Symbol>,</Symbol><Normal Text> distance</Normal Text><Symbol>,</Symbol><Normal Text> commonPrefix</Normal Text><Symbol>.</Symbol><Normal Text>count</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>sorted </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>distance </Normal Text><Symbol>==</Symbol><Normal Text> $</Normal Text><Float>1.</Float><Normal Text>distance </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>return</Keyword><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>commonPrefix </Normal Text><Symbol>></Symbol><Normal Text> $</Normal Text><Float>1.</Float><Normal Text>commonPrefix</Normal Text><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>return</Keyword><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>distance </Normal Text><Symbol><</Symbol><Normal Text> $</Normal Text><Float>1.</Float><Normal Text>distance</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.0</Float><Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>/// The Damerau-Levenshtein edit-distance between two strings</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>editDistance</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>lhs</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>_</Variable><Normal Text> </Normal Text><Variable>rhs</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> -> </Normal Text><Function>Int</Function><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lhs</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Array</Normal Text><Symbol>(</Symbol><Normal Text>lhs</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rhs</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Array</Normal Text><Symbol>(</Symbol><Normal Text>rhs</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>dist</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[[</Symbol><Normal Text>Int</Normal Text><Symbol>]]()</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> i </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> </Normal Text><Decimal>0</Decimal><Normal Text> </Normal Text><Symbol>...</Symbol><Normal Text> lhs</Normal Text><Symbol>.</Symbol><Normal Text>count </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        dist</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>([</Symbol><Normal Text>i</Normal Text><Symbol>])</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> j </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text> </Normal Text><Symbol>...</Symbol><Normal Text> rhs</Normal Text><Symbol>.</Symbol><Normal Text>count </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        dist</Normal Text><Symbol>[</Symbol><Decimal>0</Decimal><Symbol>].</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>j</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> i </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text> </Normal Text><Symbol>...</Symbol><Normal Text> lhs</Normal Text><Symbol>.</Symbol><Normal Text>count </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> j </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> </Normal Text><Decimal>1</Decimal><Normal Text> </Normal Text><Symbol>...</Symbol><Normal Text> rhs</Normal Text><Symbol>.</Symbol><Normal Text>count </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> lhs</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> rhs</Normal Text><Symbol>[</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                dist</Normal Text><Symbol>[</Symbol><Normal Text>i</Normal Text><Symbol>].</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>dist</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>][</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>])</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                dist</Normal Text><Symbol>[</Symbol><Normal Text>i</Normal Text><Symbol>].</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>min</Normal Text><Symbol>(</Symbol><Normal Text>dist</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>][</Symbol><Normal Text>j</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>,</Symbol><br/>
<Normal Text>                                   dist</Normal Text><Symbol>[</Symbol><Normal Text>i</Normal Text><Symbol>][</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>,</Symbol><br/>
<Normal Text>                                   dist</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>][</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>))</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> i </Normal Text><Symbol>></Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>,</Symbol><Normal Text> j </Normal Text><Symbol>></Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>,</Symbol><Normal Text> lhs</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> rhs</Normal Text><Symbol>[</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>],</Symbol><Normal Text> lhs</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> rhs</Normal Text><Symbol>[</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                dist</Normal Text><Symbol>[</Symbol><Normal Text>i</Normal Text><Symbol>][</Symbol><Normal Text>j</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> min</Normal Text><Symbol>(</Symbol><Normal Text>dist</Normal Text><Symbol>[</Symbol><Normal Text>i</Normal Text><Symbol>][</Symbol><Normal Text>j</Normal Text><Symbol>],</Symbol><Normal Text> dist</Normal Text><Symbol>[</Symbol><Normal Text>i </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>][</Symbol><Normal Text>j </Normal Text><Symbol>-</Symbol><Normal Text> </Normal Text><Decimal>2</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> </Normal Text><Decimal>1</Decimal><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> dist</Normal Text><Symbol>[</Symbol><Normal Text>lhs</Normal Text><Symbol>.</Symbol><Normal Text>count</Normal Text><Symbol>][</Symbol><Normal Text>rhs</Normal Text><Symbol>.</Symbol><Normal Text>count</Normal Text><Symbol>]</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse a comma-delimited list of items</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>parseCommaDelimitedList</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>string</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> -> [</Normal Text><Function>String</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> string</Normal Text><Symbol>.</Symbol><Normal Text>components</Normal Text><Symbol>(</Symbol><Normal Text>separatedBy</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>).</Symbol><Normal Text>compactMap </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>item</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>trimmingCharacters</Normal Text><Symbol>(</Symbol><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>whitespacesAndNewlines</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> item</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>?</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><Normal Text> </Normal Text><Symbol>:</Symbol><Normal Text> item</Normal Text><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse a comma-delimited string into an array of rules</Comment><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>allRules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>byName</Normal Text><Symbol>.</Symbol><Normal Text>keys</Normal Text><Symbol>)</Symbol><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>parseRules</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>rules</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> [</Normal Text><Function>String</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> parseCommaDelimitedList</Normal Text><Symbol>(</Symbol><Normal Text>rules</Normal Text><Symbol>).</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> proposedName </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>name</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> allRules</Normal Text><Symbol>.</Symbol><Normal Text>first</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            $</Normal Text><Float>0.</Float><Normal Text>lowercased</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> proposedName</Normal Text><Symbol>.</Symbol><Normal Text>lowercased</Normal Text><Symbol>()</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>})</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>return</Keyword><Normal Text> name</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            $</Normal Text><Float>0.</Float><Normal Text>argumentName </Normal Text><Symbol>==</Symbol><Normal Text> proposedName</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>})</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> rule </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>all </Normal Text><Keyword>where</Keyword><Normal Text> rule</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>proposedName</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><br/>
<Normal Text>                    </Normal Text><String>"'</String><Error>\(</Error><String>proposedName)' is not a formatting rule. Did you mean '</String><Error>\(</Error><String>rule.name)'?"</String><br/>
<Normal Text>                </Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"'</String><Error>\(</Error><String>proposedName)' is not a formatting rule"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>match</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> bestMatches</Normal Text><Symbol>(</Symbol><ControlFlowKeyword>for</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> proposedName</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> Array</Normal Text><Symbol>(</Symbol><Normal Text>allRules</Normal Text><Symbol>)).</Symbol><Normal Text>first </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unknown rule '</String><Error>\(</Error><String>proposedName)'"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unknown rule '</String><Error>\(</Error><String>proposedName)'. Did you mean '</String><Error>\(</Error><String>match)'?"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse single file path, disallowing globs or commas</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>parsePath</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>path</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>for</Variable><Normal Text> </Normal Text><Variable>argument</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>in</Variable><Normal Text> </Normal Text><Variable>directory</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> </Normal Text><Function>URL</Function><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>expandedPath</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> expandPath</Normal Text><Symbol>(</Symbol><Normal Text>path</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>FileManager</Normal Text><Symbol>.</Symbol><Keyword>default</Keyword><Symbol>.</Symbol><Normal Text>fileExists</Normal Text><Symbol>(</Symbol><Normal Text>atPath</Normal Text><Symbol>:</Symbol><Normal Text> expandedPath</Normal Text><Symbol>.</Symbol><Normal Text>path</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> path</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><String>","</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"</String><Error>\(</Error><String>argument) argument does not support multiple paths"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> pathContainsGlobSyntax</Normal Text><Symbol>(</Symbol><Normal Text>path</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"</String><Error>\(</Error><String>argument) path cannot contain wildcards"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> expandedPath</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse one or more comma-delimited file paths, expanding globs as required</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>parsePaths</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>paths</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>in</Variable><Normal Text> </Normal Text><Variable>directory</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> [</Normal Text><Function>URL</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> matchGlobs</Normal Text><Symbol>(</Symbol><Normal Text>expandGlobs</Normal Text><Symbol>(</Symbol><Normal Text>paths</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>),</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>)</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Merge two dictionaries of arguments</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>mergeArguments</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>into</Variable><Normal Text> </Normal Text><Variable>config</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> [</Normal Text><Function>String</Function><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>input</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> config</Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>output</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> args</Normal Text><br/>
<Normal Text>    </Normal Text><Comment>// Merge excluded urls</Comment><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>exclude</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> output</Normal Text><Symbol>[</Symbol><String>"exclude"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseCommaDelimitedList</Normal Text><Symbol>),</Symbol><br/>
<Normal Text>       </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>excluded</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"exclude"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>({</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>parseCommaDelimitedList</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>))</Symbol><Normal Text> </Normal Text><Symbol>})</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        excluded</Normal Text><Symbol>.</Symbol><Normal Text>formUnion</Normal Text><Symbol>(</Symbol><Normal Text>exclude</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        output</Normal Text><Symbol>[</Symbol><String>"exclude"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Array</Normal Text><Symbol>(</Symbol><Normal Text>excluded</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Comment>// Merge unexcluded urls</Comment><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>unexclude</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> output</Normal Text><Symbol>[</Symbol><String>"unexclude"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseCommaDelimitedList</Normal Text><Symbol>),</Symbol><br/>
<Normal Text>       </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>unexcluded</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"unexclude"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>({</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>parseCommaDelimitedList</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>))</Symbol><Normal Text> </Normal Text><Symbol>})</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        unexcluded</Normal Text><Symbol>.</Symbol><Normal Text>formUnion</Normal Text><Symbol>(</Symbol><Normal Text>unexclude</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        output</Normal Text><Symbol>[</Symbol><String>"unexclude"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Array</Normal Text><Symbol>(</Symbol><Normal Text>unexcluded</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Comment>// Merge rules</Comment><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> output</Normal Text><Symbol>[</Symbol><String>"rules"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            output</Normal Text><Symbol>[</Symbol><String>"rules"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            input</Normal Text><Symbol>[</Symbol><String>"rules"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            input</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            input</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>_disable</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> output</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"rules"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"rules"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>rules</Normal Text><Symbol>).</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>_disable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>enable</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>enable</Normal Text><Symbol>).</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>_disable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lintonly</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>lintonly</Normal Text><Symbol>).</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>_disable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>disable</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>disable</Normal Text><Symbol>).</Symbol><Normal Text>union</Normal Text><Symbol>(</Symbol><Normal Text>_disable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>                output</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>_enable</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> output</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>enable</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>enable</Normal Text><Symbol>).</Symbol><Normal Text>union</Normal Text><Symbol>(</Symbol><Normal Text>_enable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>                output</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lintonly</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>lintonly</Normal Text><Symbol>).</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>_enable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>disable</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>disable</Normal Text><Symbol>).</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>_enable</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>_lintonly</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> output</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lintonly</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                input</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>lintonly</Normal Text><Symbol>).</Symbol><Normal Text>union</Normal Text><Symbol>(</Symbol><Normal Text>_lintonly</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>                output</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Comment>// Merge other arguments</Comment><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>key</Normal Text><Symbol>,</Symbol><Normal Text> inValue</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> input </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>outValue</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> output</Normal Text><Symbol>[</Symbol><Normal Text>key</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            output</Normal Text><Symbol>[</Symbol><Normal Text>key</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> inValue</Normal Text><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>continue</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>argumentName </Normal Text><Symbol>==</Symbol><Normal Text> key </Normal Text><Symbol>&&</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>isSetType </Normal Text><Symbol>})</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>inOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> parseCommaDelimitedList</Normal Text><Symbol>(</Symbol><Normal Text>inValue</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>outOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> parseCommaDelimitedList</Normal Text><Symbol>(</Symbol><Normal Text>outValue</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            output</Normal Text><Symbol>[</Symbol><Normal Text>key</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>inOptions</Normal Text><Symbol>).</Symbol><Normal Text>union</Normal Text><Symbol>(</Symbol><Normal Text>outOptions</Normal Text><Symbol>).</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> output</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse a configuration file into a dictionary of arguments</Comment><br/>
<Keyword>public</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>parseConfigFile</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>data</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Data</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> [</Normal Text><Function>String</Function><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>input</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> String</Normal Text><Symbol>(</Symbol><Normal Text>data</Normal Text><Symbol>:</Symbol><Normal Text> data</Normal Text><Symbol>,</Symbol><Normal Text> encoding</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>utf8</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>reading</Normal Text><Symbol>(</Symbol><String>"Unable to read data for configuration file"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>lines</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> cumulate</Normal Text><Symbol>(</Symbol><Normal Text>successiveLines</Normal Text><Symbol>:</Symbol><Normal Text> input</Normal Text><Symbol>.</Symbol><Normal Text>components</Normal Text><Symbol>(</Symbol><Normal Text>separatedBy</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>newlines</Normal Text><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> lines</Normal Text><Symbol>.</Symbol><Normal Text>flatMap </Normal Text><Symbol>{</Symbol><Normal Text> line </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>String</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><Comment>// </Comment><Alert Level 2>TODO</Alert Level 2><Comment>: parseArguments isn't a perfect fit here - should we use a different approach?</Comment><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>line</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> line</Normal Text><Symbol>.</Symbol><Normal Text>replacingOccurrences</Normal Text><Symbol>(</Symbol><Normal Text>of</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\\</String Char><String>n"</String><Symbol>,</Symbol><Normal Text> with</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\n</String Char><String>"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>parts</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> parseArguments</Normal Text><Symbol>(</Symbol><Normal Text>line</Normal Text><Symbol>,</Symbol><Normal Text> ignoreComments</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><Symbol>).</Symbol><Normal Text>dropFirst</Normal Text><Symbol>().</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            $</Normal Text><Float>0.</Float><Normal Text>replacingOccurrences</Normal Text><Symbol>(</Symbol><Normal Text>of</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\n</String Char><String>"</String><Symbol>,</Symbol><Normal Text> with</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\\</String Char><String>n"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>key</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> parts</Normal Text><Symbol>.</Symbol><Normal Text>first </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><Symbol>[]</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>key</Normal Text><Symbol>.</Symbol><Normal Text>hasPrefix</Normal Text><Symbol>(</Symbol><String>"-"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unknown option '</String><Error>\(</Error><String>key)' in configuration file"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>key</Normal Text><Symbol>,</Symbol><Normal Text> parts</Normal Text><Symbol>.</Symbol><Normal Text>dropFirst</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>" "</String><Symbol>)]</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>do</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> preprocessArguments</Normal Text><Symbol>(</Symbol><Normal Text>arguments</Normal Text><Symbol>,</Symbol><Normal Text> optionsArguments</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>catch</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>FormatError</Variable><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><Normal Text>message</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"</String><Error>\(</Error><String>message) in configuration file"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>private</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>cumulate</Function><Symbol>(</Symbol><Variable>successiveLines</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> [</Normal Text><Function>String</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>cumulatedLines</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>String</Normal Text><Symbol>]()</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>iterator</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> successiveLines</Normal Text><Symbol>.</Symbol><Normal Text>makeIterator</Normal Text><Symbol>()</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>while</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>currentLine</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> iterator</Normal Text><Symbol>.</Symbol><Normal Text>next</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>cumulatedLine</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> effectiveContent</Normal Text><Symbol>(</Symbol><Normal Text>of</Normal Text><Symbol>:</Symbol><Normal Text> currentLine</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>while</ControlFlowKeyword><Normal Text> cumulatedLine</Normal Text><Symbol>.</Symbol><Normal Text>hasSuffix</Normal Text><Symbol>(</Symbol><String>"</String><String Char>\\</String Char><String>"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>nextLine</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> iterator</Normal Text><Symbol>.</Symbol><Normal Text>next</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>reading</Normal Text><Symbol>(</Symbol><String>"Configuration file ends with an illegal line continuation character '</String><String Char>\'</String Char><String>"</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>nextLine</Normal Text><Symbol>.</Symbol><Normal Text>trimmingCharacters</Normal Text><Symbol>(</Symbol><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>whitespaces</Normal Text><Symbol>).</Symbol><Normal Text>starts</Normal Text><Symbol>(</Symbol><Normal Text>with</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"#"</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                cumulatedLine </Normal Text><Symbol>=</Symbol><Normal Text> cumulatedLine</Normal Text><Symbol>.</Symbol><Normal Text>dropLast</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> effectiveContent</Normal Text><Symbol>(</Symbol><Normal Text>of</Normal Text><Symbol>:</Symbol><Normal Text> nextLine</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        cumulatedLines</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>String</Normal Text><Symbol>(</Symbol><Normal Text>cumulatedLine</Normal Text><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> cumulatedLines</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>private</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>effectiveContent</Function><Symbol>(</Symbol><Variable>of</Variable><Normal Text> </Normal Text><Variable>line</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> -> </Normal Text><Function>String</Function><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> line</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>prefix </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Decimal>0</Decimal><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><String>"#"</String><Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>trimmingCharacters</Normal Text><Symbol>(</Symbol><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>whitespaces</Normal Text><Symbol>)</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Serialize a set of options into either an arguments string or a file</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>serialize</Function><Symbol>(</Symbol><Variable>options</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Options</Data Type><Symbol>,</Symbol><br/>
<Normal Text>               </Normal Text><Variable>swiftVersion</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Version</Data Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>undefined</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>               </Normal Text><Variable>excludingDefaults</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Bool</Data Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> false</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>               </Normal Text><Variable>separator</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\n</String Char><String>"</String><Symbol>)</Symbol><Normal Text> -> </Normal Text><Function>String</Function><br/>
<Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[[</Symbol><Normal Text>String</Normal Text><Symbol>:</Symbol><Normal Text> String</Normal Text><Symbol>]]()</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>fileOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>fileOptions </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        arguments</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>argumentsFor</Normal Text><Symbol>(</Symbol><br/>
<Normal Text>            Options</Normal Text><Symbol>(</Symbol><Normal Text>fileOptions</Normal Text><Symbol>:</Symbol><Normal Text> fileOptions</Normal Text><Symbol>),</Symbol><br/>
<Normal Text>            excludingDefaults</Normal Text><Symbol>:</Symbol><Normal Text> excludingDefaults</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>formatOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>formatOptions </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        arguments</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>argumentsFor</Normal Text><Symbol>(</Symbol><br/>
<Normal Text>            Options</Normal Text><Symbol>(</Symbol><Normal Text>formatOptions</Normal Text><Symbol>:</Symbol><Normal Text> formatOptions</Normal Text><Symbol>),</Symbol><br/>
<Normal Text>            excludingDefaults</Normal Text><Symbol>:</Symbol><Normal Text> excludingDefaults</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> swiftVersion </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><Symbol>.</Symbol><Normal Text>undefined </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>descriptor</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>swiftVersion</Normal Text><br/>
<Normal Text>        arguments</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>([</Symbol><Normal Text>descriptor</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><Symbol>:</Symbol><Normal Text> swiftVersion</Normal Text><Symbol>.</Symbol><Normal Text>rawValue</Normal Text><Symbol>])</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>rules </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        arguments</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><Normal Text>argumentsFor</Normal Text><Symbol>(</Symbol><br/>
<Normal Text>            Options</Normal Text><Symbol>(</Symbol><Normal Text>rules</Normal Text><Symbol>:</Symbol><Normal Text> rules</Normal Text><Symbol>),</Symbol><br/>
<Normal Text>            excludingDefaults</Normal Text><Symbol>:</Symbol><Normal Text> excludingDefaults</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> arguments</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> serialize</Normal Text><Symbol>(</Symbol><Normal Text>arguments</Normal Text><Symbol>:</Symbol><Normal Text> $</Normal Text><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> separator</Normal Text><Symbol>:</Symbol><Normal Text> separator</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>filter </Normal Text><Symbol>{</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>$</Normal Text><Float>0.</Float><Normal Text>isEmpty </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>.</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> separator</Normal Text><Symbol>)</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Serialize arguments</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>serialize</Function><Symbol>(</Symbol><Variable>arguments</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>               </Normal Text><Variable>separator</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\n</String Char><String>"</String><Symbol>)</Symbol><Normal Text> -> </Normal Text><Function>String</Function><br/>
<Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> arguments</Normal Text><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>value</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> $</Normal Text><Decimal>1</Decimal><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> value</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><String>" "</String><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            value </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\"</String Char><Error>\(</Error><String>value.replacingOccurrences(of: "</String><Normal Text>\</Normal Text><String>""</String><Symbol>,</Symbol><Normal Text> with</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"</String><String Char>\\\"</String Char><String>"</String><Symbol>))</Symbol><Normal Text>\</Normal Text><String>""</String><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><String>"--</String><Error>\(</Error><String Interpolation>$</String Interpolation><String>0) </String><Error>\(</Error><String>value)"</String><br/>
<Normal Text>    </Normal Text><Symbol>}.</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> separator</Normal Text><Symbol>)</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Get command line arguments from options</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>argumentsFor</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>options</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Options</Data Type><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>excludingDefaults</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Bool</Data Type><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> false</Normal Text><Symbol>)</Symbol><Normal Text> -> [</Normal Text><Function>String</Function><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>args</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>String</Normal Text><Symbol>:</Symbol><Normal Text> String</Normal Text><Symbol>]()</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>fileOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>fileOptions </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>fileArguments</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>do</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>excludingDefaults </Normal Text><Symbol>||</Symbol><Normal Text> fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>followSymlinks </Normal Text><Symbol>!=</Symbol><Normal Text> FileOptions</Normal Text><Symbol>.</Symbol><Keyword>default</Keyword><Symbol>.</Symbol><Normal Text>followSymlinks </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                args</Normal Text><Symbol>[</Symbol><String>"symlinks"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>followSymlinks </Normal Text><Symbol>?</Symbol><Normal Text> </Normal Text><String>"follow"</String><Normal Text> </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>"ignore"</String><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            arguments</Normal Text><Symbol>.</Symbol><Normal Text>remove</Normal Text><Symbol>(</Symbol><String>"symlinks"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>do</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>excludedGlobs</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Comment>// </Comment><Alert Level 2>TODO</Alert Level 2><Comment>: find a better alternative to stringifying url</Comment><br/>
<Normal Text>                args</Normal Text><Symbol>[</Symbol><String>"exclude"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>excludedGlobs</Normal Text><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>description </Normal Text><Symbol>}.</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            arguments</Normal Text><Symbol>.</Symbol><Normal Text>remove</Normal Text><Symbol>(</Symbol><String>"exclude"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>do</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>unexcludedGlobs</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Comment>// </Comment><Alert Level 2>TODO</Alert Level 2><Comment>: find a better alternative to stringifying url</Comment><br/>
<Normal Text>                args</Normal Text><Symbol>[</Symbol><String>"unexclude"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>unexcludedGlobs</Normal Text><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>description </Normal Text><Symbol>}.</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            arguments</Normal Text><Symbol>.</Symbol><Normal Text>remove</Normal Text><Symbol>(</Symbol><String>"unexclude"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>do</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>excludingDefaults </Normal Text><Symbol>||</Symbol><Normal Text> fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>minVersion </Normal Text><Symbol>!=</Symbol><Normal Text> FileOptions</Normal Text><Symbol>.</Symbol><Keyword>default</Keyword><Symbol>.</Symbol><Normal Text>minVersion </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                args</Normal Text><Symbol>[</Symbol><String>"minversion"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> fileOptions</Normal Text><Symbol>.</Symbol><Normal Text>minVersion</Normal Text><Symbol>.</Symbol><Normal Text>description</Normal Text><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            arguments</Normal Text><Symbol>.</Symbol><Normal Text>remove</Normal Text><Symbol>(</Symbol><String>"minversion"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        assert</Normal Text><Symbol>(</Symbol><Normal Text>arguments</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>formatOptions</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>formatOptions </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> descriptor </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all </Normal Text><Keyword>where</Keyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>descriptor</Normal Text><Symbol>.</Symbol><Normal Text>isRenamed </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>value</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> descriptor</Normal Text><Symbol>.</Symbol><Normal Text>fromOptions</Normal Text><Symbol>(</Symbol><Normal Text>formatOptions</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> value </Normal Text><Symbol>!=</Symbol><Normal Text> descriptor</Normal Text><Symbol>.</Symbol><Normal Text>fromOptions</Normal Text><Symbol>(.</Symbol><Keyword>default</Keyword><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>||</Symbol><br/>
<Normal Text>                </Normal Text><Symbol>(!</Symbol><Normal Text>excludingDefaults </Normal Text><Symbol>&&</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>descriptor</Normal Text><Symbol>.</Symbol><Normal Text>isDeprecated</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><ControlFlowKeyword>continue</ControlFlowKeyword><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><Comment>// Special case for swiftVersion</Comment><br/>
<Normal Text>            </Normal Text><Comment>// </Comment><Alert Level 2>TODO</Alert Level 2><Comment>: find a better solution for this</Comment><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> descriptor</Normal Text><Symbol>.</Symbol><Normal Text>argumentName </Normal Text><Symbol>==</Symbol><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>swiftVersion</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>               value </Normal Text><Symbol>==</Symbol><Normal Text> Version</Normal Text><Symbol>.</Symbol><Normal Text>undefined</Normal Text><Symbol>.</Symbol><Normal Text>rawValue</Normal Text><br/>
<Normal Text>            </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><ControlFlowKeyword>continue</ControlFlowKeyword><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            args</Normal Text><Symbol>[</Symbol><Normal Text>descriptor</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> value</Normal Text><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Comment>// Special case for wrapParameters</Comment><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>argumentName</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>wrapParameters</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>[</Symbol><Normal Text>argumentName</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>==</Symbol><Normal Text> WrapMode</Normal Text><Symbol>.</Symbol><Keyword>default</Keyword><Symbol>.</Symbol><Normal Text>rawValue </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            args</Normal Text><Symbol>[</Symbol><Normal Text>argumentName</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> args</Normal Text><Symbol>[</Symbol><Normal Text>Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>wrapArguments</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><Symbol>]</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>lint </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        args</Normal Text><Symbol>[</Symbol><String>"lint"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>""</String><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> options</Normal Text><Symbol>.</Symbol><Normal Text>rules </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>defaultRules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> allRules</Normal Text><Symbol>.</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>disabledByDefault</Normal Text><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>enabled</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>defaultRules</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>enabled</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            args</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> enabled</Normal Text><Symbol>.</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>        </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>disabled</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> defaultRules</Normal Text><Symbol>.</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>rules</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>disabled</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            args</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> disabled</Normal Text><Symbol>.</Symbol><Normal Text>sorted</Normal Text><Symbol>().</Symbol><Normal Text>joined</Normal Text><Symbol>(</Symbol><Normal Text>separator</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><String>","</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> args</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>private</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>processOption</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>key</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>,</Symbol><br/>
<Normal Text>                           </Normal Text><Variable>in</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><br/>
<Normal Text>                           </Normal Text><Variable>from</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>inout</Data Type><Normal Text> </Normal Text><Variable>Set</Variable><Normal Text><</Normal Text><Variable>String</Variable><Normal Text>></Normal Text><Symbol>,</Symbol><br/>
<Normal Text>                           </Normal Text><Variable>handler</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Data Type>throws</Data Type><Normal Text> -> </Normal Text><Variable>Void</Variable><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><br/>
<Symbol>{</Symbol><br/>
<Normal Text>    precondition</Normal Text><Symbol>(</Symbol><Normal Text>optionsArguments</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>key</Normal Text><Symbol>),</Symbol><Normal Text> </Normal Text><String>"</String><Error>\(</Error><String>key) not in optionsArguments"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> from</Normal Text><br/>
<Normal Text>    arguments</Normal Text><Symbol>.</Symbol><Normal Text>remove</Normal Text><Symbol>(</Symbol><Normal Text>key</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    from </Normal Text><Symbol>=</Symbol><Normal Text> arguments</Normal Text><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>value</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> args</Normal Text><Symbol>[</Symbol><Normal Text>key</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>do</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> handler</Normal Text><Symbol>(</Symbol><Normal Text>value</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>catch</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>value</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"--</String><Error>\(</Error><String>key) option expects a value"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>FormatError</Variable><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><Normal Text>string</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> error</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>string</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>string</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>key</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                string </Normal Text><Symbol>+=</Symbol><Normal Text> </Normal Text><String>" in --</String><Error>\(</Error><String>key)"</String><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><Normal Text>string</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unsupported --</String><Error>\(</Error><String>key) value '</String><Error>\(</Error><String>value)'"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse rule names from arguments</Comment><br/>
<Keyword>public</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>rulesFor</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>lint</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>Bool</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> </Normal Text><Function>Set</Function><Symbol><</Symbol><Data Type>String</Data Type><Symbol>></Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>rules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> allRules</Normal Text><br/>
<Normal Text>    rules </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>[</Symbol><String>"rules"</String><Symbol>].</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><Symbol>??</Symbol><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>subtracting</Normal Text><Symbol>(</Symbol><Normal Text>FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>disabledByDefault</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>[</Symbol><String>"enable"</String><Symbol>].</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>formUnion</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>[</Symbol><String>"disable"</String><Symbol>].</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>subtract</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>))</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>[</Symbol><String>"lintonly"</String><Symbol>].</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> rulesString </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> lint </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>formUnion</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>(</Symbol><Normal Text>rulesString</Normal Text><Symbol>))</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> rules</Normal Text><Symbol>.</Symbol><Normal Text>subtract</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>(</Symbol><Normal Text>rulesString</Normal Text><Symbol>))</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> rules</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse FileOptions from arguments</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>fileOptionsFor</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><Variable>in</Variable><Normal Text> </Normal Text><Variable>directory</Variable><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> </Normal Text><Function>FileOptions</Function><Normal Text>? </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>options</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> FileOptions</Normal Text><Symbol>()</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>fileArguments</Normal Text><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>containsFileOption</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> processOption</Normal Text><Symbol>(</Symbol><String>"symlinks"</String><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> args</Normal Text><Symbol>,</Symbol><Normal Text> from</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>arguments</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        containsFileOption </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>switch</ControlFlowKeyword><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>lowercased</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"follow"</String><Symbol>:</Symbol><br/>
<Normal Text>            options</Normal Text><Symbol>.</Symbol><Normal Text>followSymlinks </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>case</ControlFlowKeyword><Normal Text> </Normal Text><String>"ignore"</String><Symbol>:</Symbol><br/>
<Normal Text>            options</Normal Text><Symbol>.</Symbol><Normal Text>followSymlinks </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>        </Normal Text><Keyword>default</Keyword><Symbol>:</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>""</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> processOption</Normal Text><Symbol>(</Symbol><String>"exclude"</String><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> args</Normal Text><Symbol>,</Symbol><Normal Text> from</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>arguments</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        containsFileOption </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        options</Normal Text><Symbol>.</Symbol><Normal Text>excludedGlobs </Normal Text><Symbol>+=</Symbol><Normal Text> expandGlobs</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> processOption</Normal Text><Symbol>(</Symbol><String>"unexclude"</String><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> args</Normal Text><Symbol>,</Symbol><Normal Text> from</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>arguments</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        containsFileOption </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        options</Normal Text><Symbol>.</Symbol><Normal Text>unexcludedGlobs </Normal Text><Symbol>+=</Symbol><Normal Text> expandGlobs</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> directory</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> processOption</Normal Text><Symbol>(</Symbol><String>"minversion"</String><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> args</Normal Text><Symbol>,</Symbol><Normal Text> from</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>arguments</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        containsFileOption </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>minVersion</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Version</Normal Text><Symbol>(</Symbol><Normal Text>rawValue</Normal Text><Symbol>:</Symbol><Normal Text> $</Normal Text><Decimal>0</Decimal><Symbol>)</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Unsupported --minversion value '</String><Error>\(</Error><String Interpolation>$</String Interpolation><String>0)'"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> minVersion </Normal Text><Symbol><=</Symbol><Normal Text> Version</Normal Text><Symbol>(</Symbol><Normal Text>stringLiteral</Normal Text><Symbol>:</Symbol><Normal Text> swiftFormatVersion</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><Keyword>throw</Keyword><Normal Text> FormatError</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>(</Symbol><String>"Project specifies SwiftFormat --minversion of </String><Error>\(</Error><String>minVersion)"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        options</Normal Text><Symbol>.</Symbol><Normal Text>minVersion </Normal Text><Symbol>=</Symbol><Normal Text> minVersion</Normal Text><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    assert</Normal Text><Symbol>(</Symbol><Normal Text>arguments</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><String>"</String><Error>\(</Error><String>arguments.joined(separator: "</String><Symbol>,</Symbol><String>"))"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> containsFileOption </Normal Text><Symbol>?</Symbol><Normal Text> options </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Parse FormatOptions from arguments</Comment><br/>
<Comment>// Returns nil if the arguments dictionary does not contain any formatting arguments</Comment><br/>
<Keyword>public</Keyword><Normal Text> </Normal Text><Keyword>func</Keyword><Normal Text> </Normal Text><Function>formatOptionsFor</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Keyword>throws</Keyword><Normal Text> -> </Normal Text><Function>FormatOptions</Function><Normal Text>? </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>options</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> FormatOptions</Normal Text><Symbol>.</Symbol><Keyword>default</Keyword><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>arguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>formattingArguments</Normal Text><Symbol>)</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>containsFormatOption</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> option </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> processOption</Normal Text><Symbol>(</Symbol><Normal Text>option</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Symbol>:</Symbol><Normal Text> args</Normal Text><Symbol>,</Symbol><Normal Text> from</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>arguments</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            containsFormatOption </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Normal Text> option</Normal Text><Symbol>.</Symbol><Normal Text>toOptions</Normal Text><Symbol>(</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Symbol>&</Symbol><Normal Text>options</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    assert</Normal Text><Symbol>(</Symbol><Normal Text>arguments</Normal Text><Symbol>.</Symbol><Normal Text>isEmpty</Normal Text><Symbol>,</Symbol><Normal Text> </Normal Text><String>"</String><Error>\(</Error><String>arguments.joined(separator: "</String><Symbol>,</Symbol><String>"))"</String><Symbol>)</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> containsFormatOption </Normal Text><Symbol>?</Symbol><Normal Text> options </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Get deprecation warnings from a set of arguments</Comment><br/>
<Keyword>func</Keyword><Normal Text> </Normal Text><Function>warningsForArguments</Function><Symbol>(</Symbol><Variable>_</Variable><Normal Text> </Normal Text><Variable>args</Variable><Symbol>:</Symbol><Normal Text> [</Normal Text><Data Type>String</Data Type><Symbol>:</Symbol><Normal Text> </Normal Text><Data Type>String</Data Type><Normal Text>]</Normal Text><Symbol>)</Symbol><Normal Text> -> [</Normal Text><Function>String</Function><Normal Text>] </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>var</Keyword><Normal Text> </Normal Text><Variable>warnings</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>String</Normal Text><Symbol>]()</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> option </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>[</Symbol><Normal Text>option</Normal Text><Symbol>.</Symbol><Normal Text>argumentName</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>!=</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><Symbol>,</Symbol><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>message</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> option</Normal Text><Symbol>.</Symbol><Normal Text>deprecationMessage </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            warnings</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><String>"--</String><Error>\(</Error><String>option.argumentName) option is deprecated. </String><Error>\(</Error><String>message)"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> name </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> Set</Normal Text><Symbol>(</Symbol><Normal Text>rulesArguments</Normal Text><Symbol>.</Symbol><Normal Text>flatMap </Normal Text><Symbol>{</Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><ControlFlowKeyword>try</ControlFlowKeyword><Symbol>?</Symbol><Normal Text> args</Normal Text><Symbol>[</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>].</Symbol><Normal Text>map</Normal Text><Symbol>(</Symbol><Normal Text>parseRules</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>??</Symbol><Normal Text> </Normal Text><Symbol>[])</Symbol><Normal Text> </Normal Text><Symbol>??</Symbol><Normal Text> </Normal Text><Symbol>[]</Symbol><Normal Text> </Normal Text><Symbol>})</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>message</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>byName</Normal Text><Symbol>[</Symbol><Normal Text>name</Normal Text><Symbol>]?.</Symbol><Normal Text>deprecationMessage </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            warnings</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><String>"</String><Error>\(</Error><String>name) rule is deprecated. </String><Error>\(</Error><String>message)"</String><Symbol>)</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rules</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>try</ControlFlowKeyword><Symbol>?</Symbol><Normal Text> rulesFor</Normal Text><Symbol>(</Symbol><Normal Text>args</Normal Text><Symbol>,</Symbol><Normal Text> lint</Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Keyword>true</Keyword><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><ControlFlowKeyword>for</ControlFlowKeyword><Normal Text> arg </Normal Text><ControlFlowKeyword>in</ControlFlowKeyword><Normal Text> args</Normal Text><Symbol>.</Symbol><Normal Text>keys </Normal Text><Keyword>where</Keyword><Normal Text> formattingArguments</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>            </Normal Text><ControlFlowKeyword>if</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>!</Symbol><Normal Text>rules</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><ControlFlowKeyword>guard</ControlFlowKeyword><Normal Text> </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rule</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>byName</Normal Text><Symbol>[</Symbol><Normal Text>$</Normal Text><Decimal>0</Decimal><Symbol>]</Symbol><Normal Text> </Normal Text><ControlFlowKeyword>else</ControlFlowKeyword><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                    </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><Keyword>false</Keyword><br/>
<Normal Text>                </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>return</Keyword><Normal Text> rule</Normal Text><Symbol>.</Symbol><Normal Text>options</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>||</Symbol><Normal Text> rule</Normal Text><Symbol>.</Symbol><Normal Text>sharedOptions</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>})</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                </Normal Text><Keyword>let</Keyword><Normal Text> </Normal Text><Variable>expected</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> FormatRules</Normal Text><Symbol>.</Symbol><Normal Text>all</Normal Text><Symbol>.</Symbol><Normal Text>first</Normal Text><Symbol>(</Symbol><Keyword>where</Keyword><Symbol>:</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>                    $</Normal Text><Float>0.</Float><Normal Text>options</Normal Text><Symbol>.</Symbol><Normal Text>contains</Normal Text><Symbol>(</Symbol><Normal Text>arg</Normal Text><Symbol>)</Symbol><br/>
<Normal Text>                </Normal Text><Symbol>})?.</Symbol><Normal Text>name </Normal Text><Symbol>??</Symbol><Normal Text> </Normal Text><String>"associated"</String><br/>
<Normal Text>                warnings</Normal Text><Symbol>.</Symbol><Normal Text>append</Normal Text><Symbol>(</Symbol><String>"--</String><Error>\(</Error><String>arg) option has no effect when </String><Error>\(</Error><String>expected) rule is disabled"</String><Symbol>)</Symbol><br/>
<Normal Text>            </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>        </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> warnings</Normal Text><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>fileArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><br/>
<Normal Text>    </Normal Text><String>"symlinks"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"exclude"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"unexclude"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"minversion"</String><Symbol>,</Symbol><br/>
<Symbol>]</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>rulesArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><br/>
<Normal Text>    </Normal Text><String>"disable"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"enable"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"lintonly"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"rules"</String><Symbol>,</Symbol><br/>
<Symbol>]</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>formattingArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>formatting</Normal Text><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>argumentName </Normal Text><Symbol>}</Symbol><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>internalArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Keyword>internal</Keyword><Symbol>.</Symbol><Normal Text>map </Normal Text><Symbol>{</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>argumentName </Normal Text><Symbol>}</Symbol><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>optionsArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> fileArguments </Normal Text><Symbol>+</Symbol><Normal Text> rulesArguments </Normal Text><Symbol>+</Symbol><Normal Text> formattingArguments </Normal Text><Symbol>+</Symbol><Normal Text> internalArguments</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>commandLineArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Symbol>[</Symbol><br/>
<Normal Text>    </Normal Text><Comment>// Input options</Comment><br/>
<Normal Text>    </Normal Text><String>"filelist"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"stdinpath"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"config"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"inferoptions"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"linerange"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"output"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"cache"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"dryrun"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"lint"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"lenient"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"verbose"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"quiet"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"report"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><Comment>// Misc</Comment><br/>
<Normal Text>    </Normal Text><String>"help"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"version"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"options"</String><Symbol>,</Symbol><br/>
<Normal Text>    </Normal Text><String>"ruleinfo"</String><Symbol>,</Symbol><br/>
<Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> optionsArguments</Normal Text><br/>
<Normal Text></Normal Text><br/>
<Keyword>let</Keyword><Normal Text> </Normal Text><Variable>deprecatedArguments</Variable><Normal Text> </Normal Text><Symbol>=</Symbol><Normal Text> Descriptors</Normal Text><Symbol>.</Symbol><Normal Text>all</Normal Text><Symbol>.</Symbol><Normal Text>compactMap </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    $</Normal Text><Float>0.</Float><Normal Text>isDeprecated </Normal Text><Symbol>?</Symbol><Normal Text> $</Normal Text><Float>0.</Float><Normal Text>argumentName </Normal Text><Symbol>:</Symbol><Normal Text> </Normal Text><Keyword>nil</Keyword><br/>
<Symbol>}</Symbol><br/>
