4e63e2f5d2cf

adopt: Update site.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 21 May 2019 22:54:49 -0400
parents eb53a71be42c
children 266f41cf65f0
branches/tags (none)
files adopt/changelog/index.html adopt/reference/index.html

Changes

--- a/adopt/changelog/index.html	Tue May 21 22:07:39 2019 -0400
+++ b/adopt/changelog/index.html	Tue May 21 22:54:49 2019 -0400
@@ -15,10 +15,10 @@
 <h1 id="changelog"><a href="">Changelog</a></h1><p>Here's the list of changes in each released version.</p>
 <div class="toc">
 <ul>
-<li><a href="#current-development-version">Current Development Version</a></li>
+<li><a href="#100">1.0.0</a></li>
 </ul></div>
-<h2 id="current-development-version">Current Development Version</h2>
-<p>Adopt is still in active development.  No promises yet.</p>
+<h2 id="100">1.0.0</h2>
+<p>Initial release.</p>
                 </div>
             <footer><p><i>Made with Lisp and love by <a href="http://stevelosh.com/">Steve Losh</a>.</i></p>
 <p><a href="http://rochestermade.com" title="Rochester Made"><img src="http://rochestermade.com/media/images/rochester-made-dark-on-light.png" alt="Rochester Made" title="Rochester Made"/></a></p>
--- a/adopt/reference/index.html	Tue May 21 22:07:39 2019 -0400
+++ b/adopt/reference/index.html	Tue May 21 22:54:49 2019 -0400
@@ -52,9 +52,9 @@
 
 
 <p>Return a list of the program name and command line arguments.</p>
-<p>This is not implemented for every Common Lisp implementation.  You can always
-  pass your own values to <code>parse-options</code> and <code>print-help</code> if it's not
-  implemented for your particular Lisp.</p>
+<p>This is not implemented for every Common Lisp implementation.  You can pass
+  your own values to <code>parse-options</code> and <code>print-help</code> if it's not implemented
+  for your particular Lisp.</p>
 <h3 id="collect-function"><code>COLLECT</code> (function)</h3>
 <div class="codehilite"><pre><span/>(COLLECT LIST EL)
 </pre></div>
@@ -89,6 +89,10 @@
 </pre></div>
 
 
+<p>Exit the program with status <code>code</code>.</p>
+<p>This is not implemented for every Common Lisp implementation.  You can write
+  your own version of it and pass it to <code>print-help-and-exit</code> and
+  <code>print-error-and-exit</code> if it's not implemented for your particular Lisp.</p>
 <h3 id="first-function"><code>FIRST</code> (function)</h3>
 <div class="codehilite"><pre><span/>(FIRST OLD NEW)
 </pre></div>
@@ -126,17 +130,65 @@
 </pre></div>
 
 
+<p>Create and return an option group, suitable for use in an interface.</p>
+<p>This function takes a number of arguments that define how the group is
+  presented to the user:</p>
+<ul>
+<li><code>name</code> (<strong>required</strong>): a symbol naming the group.</li>
+<li><code>title</code> (optional): a title for the group for use in the help text.</li>
+<li><code>help</code> (optional): a short summary of this group of options for use in the help text.</li>
+<li><code>manual</code> (optional): used in place of <code>help</code> when rendering a man page.</li>
+<li><code>options</code> (<strong>required</strong>): the options to include in the group.</li>
+</ul>
+<p>See the full documentation for more information.</p>
 <h3 id="make-interface-function"><code>MAKE-INTERFACE</code> (function)</h3>
 <div class="codehilite"><pre><span/>(MAKE-INTERFACE &amp;KEY NAME SUMMARY USAGE HELP MANUAL EXAMPLES CONTENTS)
 </pre></div>
 
 
+<p>Create and return a command line interface.</p>
+<p>This function takes a number of arguments that define how the interface is
+  presented to the user:</p>
+<ul>
+<li><code>name</code> (<strong>required</strong>): a symbol naming the interface.</li>
+<li><code>summary</code> (<strong>required</strong>): a string of a concise, one-line summary of what the program does.</li>
+<li><code>usage</code> (<strong>required</strong>): a string of a UNIX-style usage summary, e.g. "[OPTIONS] PATTERN [FILE...]".</li>
+<li><code>help</code> (<strong>required</strong>): a string of a longer description of the program.</li>
+<li><code>manual</code> (optional): a string to use in place of <code>help</code> when rendering a man page.</li>
+<li><code>examples</code> (optional): an alist of <code>(prose . command)</code> conses to render as a list of examples.</li>
+<li><code>contents</code> (optional): a list of options and groups.  Ungrouped options will be collected into a single top-level group.</li>
+</ul>
+<p>See the full documentation for more information.</p>
 <h3 id="make-option-function"><code>MAKE-OPTION</code> (function)</h3>
-<div class="codehilite"><pre><span/>(MAKE-OPTION NAME &amp;KEY LONG SHORT HELP MANUAL PARAMETER REDUCE (RESULT-KEY NAME)
-             (INITIAL-VALUE NIL INITIAL-VALUE?) (KEY #'IDENTITY) (FINALLY #'IDENTITY))
+<div class="codehilite"><pre><span/>(MAKE-OPTION NAME &amp;KEY LONG SHORT HELP MANUAL PARAMETER REDUCE
+             (INITIAL-VALUE NIL INITIAL-VALUE?) (RESULT-KEY NAME) (KEY #'IDENTITY)
+             (FINALLY #'IDENTITY))
 </pre></div>
 
 
+<p>Create and return an option, suitable for use in an interface.</p>
+<p>This function takes a number of arguments, some required, that define how the
+  option interacts with the user.</p>
+<ul>
+<li><code>name</code> (<strong>required</strong>): a symbol naming the option.</li>
+<li><code>help</code> (<strong>required</strong>): a short string describing what the option does.</li>
+<li><code>result-key</code> (optional): a symbol to use as the key for this option in the hash table of results.</li>
+<li><code>long</code> (optional): a string for the long form of the option (e.g. <code>--foo</code>).</li>
+<li><code>short</code> (optional): a character for the short form of the option (e.g. <code>-f</code>).  At least one of <code>short</code> and <code>long</code> must be given.</li>
+<li><code>manual</code> (optional): a string to use in place of <code>help</code> when rendering a man page.</li>
+<li><code>parameter</code> (optional): a string.  If given, it will turn this option into a parameter-taking option (e.g. <code>--foo=bar</code>) and will be used as a placeholder
+  in the help text.</li>
+<li><code>reduce</code> (<strong>required</strong>): a function designator that will be called every time the option is specified by the user.</li>
+<li><code>initial-value</code> (optional): a value to use as the initial value of the option.</li>
+<li><code>key</code> (optional): a function designator, only allowed for parameter-taking options, to be called on the values given by the user before they are passed along to the reducing function.  It will not be called on the initial value.</li>
+<li><code>finally</code> (optional): a function designator to be called on the final result after all parsing is complete. </li>
+</ul>
+<p>The manner in which the reducer is called depends on whether the option takes a parameter:</p>
+<ul>
+<li>For options that don't take parameters, it will be called with the old value.</li>
+<li>For options that take parameters, it will be called with the old value and the value given by the user.</li>
+</ul>
+<p>See the full documentation for more information.</p>
 <h3 id="parse-options-function"><code>PARSE-OPTIONS</code> (function)</h3>
 <div class="codehilite"><pre><span/>(PARSE-OPTIONS INTERFACE &amp;OPTIONAL (ARGUMENTS (REST (ARGV))))
 </pre></div>
@@ -151,7 +203,8 @@
 </ol>
 <p>See the full documentation for more information.</p>
 <h3 id="print-error-and-exit-function"><code>PRINT-ERROR-AND-EXIT</code> (function)</h3>
-<div class="codehilite"><pre><span/>(PRINT-ERROR-AND-EXIT ERROR &amp;KEY (STREAM *ERROR-OUTPUT*) (EXIT-CODE 1) (PREFIX error: ))
+<div class="codehilite"><pre><span/>(PRINT-ERROR-AND-EXIT ERROR &amp;KEY (STREAM *ERROR-OUTPUT*) (EXIT-FUNCTION #'EXIT) (EXIT-CODE 1)
+                      (PREFIX error: ))
 </pre></div>
 
 
@@ -206,7 +259,8 @@
 
 <h3 id="print-help-and-exit-function"><code>PRINT-HELP-AND-EXIT</code> (function)</h3>
 <div class="codehilite"><pre><span/>(PRINT-HELP-AND-EXIT INTERFACE &amp;KEY (STREAM *STANDARD-OUTPUT*) (PROGRAM-NAME (CAR (ARGV)))
-                     (WIDTH 80) (OPTION-WIDTH 20) (INCLUDE-EXAMPLES T) (EXIT-CODE 0))
+                     (WIDTH 80) (OPTION-WIDTH 20) (INCLUDE-EXAMPLES T) (EXIT-FUNCTION #'EXIT)
+                     (EXIT-CODE 0))
 </pre></div>
 
 
@@ -224,6 +278,15 @@
 </pre></div>
 
 
+<p>Print a troff-formatted man page for <code>interface</code> to <code>stream</code>.</p>
+<p>Example:</p>
+<div class="codehilite"><pre><span/>(with-open-file (manual "man/man1/foo.1"
+                        :direction :output
+                        :if-exists :supersede)
+  (print-manual *ui* manual))
+</pre></div>
+
+
 <h3 id="supply-new-value-function"><code>SUPPLY-NEW-VALUE</code> (function)</h3>
 <div class="codehilite"><pre><span/>(SUPPLY-NEW-VALUE CONDITION VALUE)
 </pre></div>