ef83f7d0ced1

adopt: Update site.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 17 May 2019 23:28:21 -0400
parents e1a7aced6cbf
children 3a6ceb8611fa
branches/tags (none)
files adopt/usage/index.html

Changes

--- a/adopt/usage/index.html	Fri May 17 23:17:29 2019 -0400
+++ b/adopt/usage/index.html	Fri May 17 23:28:21 2019 -0400
@@ -26,6 +26,7 @@
 <li><a href="#exiting">Exiting</a></li>
 <li><a href="#options">Options</a></li>
 <li><a href="#parsing">Parsing</a></li>
+<li><a href="#option-formats">Option Formats</a></li>
 <li><a href="#top-level-structure">Top-Level Structure</a></li>
 <li><a href="#computing-values-with-reduce">Computing Values with Reduce</a><ul>
 <li><a href="#simple-options">Simple Options</a></li>
@@ -368,6 +369,17 @@
 
 <p>This can come in useful if you want multiple options that affect the same result
 (e.g. <code>--verbose</code> and <code>--silent</code> flags that toggle extra log output on and off).</p>
+<h2 id="option-formats">Option Formats</h2>
+<p>Adopt tries to support the most common styles of long and short UNIX options.</p>
+<p>Long options must be given with two dashes (<code>--foo</code>).  If a long option takes
+a parameter it can be given as the next argument (<code>--foo meow</code>) or mashed
+together into the same argument using an equals sign (<code>--foo=meow</code>).</p>
+<p>Short options must be given with a single dash (<code>-f</code>).  If several short options
+do not take any parameters, they can be mashed together and given all at once
+(<code>-xzvf</code>).  If a short option takes a parameter it can be given as the next
+argument (<code>-n foo</code>) or mashed together with the option <code>-nfoo</code>.</p>
+<p>The special string <code>--</code> signals that all remaining arguments are normal text
+arguments, and should not be parsed as options.</p>
 <h2 id="top-level-structure">Top-Level Structure</h2>
 <p>We'll look at how the option values are computed shortly, but first let's see
 the overall structure of the programs you'll typically create with Adopt:</p>