emacs.d/clones/lisp/www.cliki.net/unix-options.html
2022-10-07 15:47:14 +02:00

69 lines
No EOL
5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CLiki: unix-options</title>
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
href="https://www.cliki.net/site/feed/article.atom?title=unix-options">
<link rel="stylesheet" href="static/css/style.css">
<link rel="stylesheet" href="static/css/colorize.css">
</head>
<body>
<span class="hidden">CLiki - unix-options</span>
<div id="content"><div id="content-area"><div id="article-title">unix-options</div><div id="article">unix-options is a library for processing <a href="Unix.html" class="category">Unix</a>-style command-line arguments. Can act as a simple Getopt for Lisp or can automatically bind values passed in from the CLI. Ordinary usage is as simple as specifying which variables you need to be set from the command-line.<p>For example:<p><div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen">asdf:oos 'asdf:load-op 'unix-options</span>)</span>
<span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_use-package.html" class="symbol">use-package</a> 'unix-options</span>)</span>
<span class="paren1">(<span class="nonparen"><i><span class="symbol">with-cli-options</span></i> <span class="paren2">(<span class="nonparen"></span>)</span> <span class="paren2">(<span class="nonparen">alpha beta delta &amp;parameters file</span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" class="symbol">print</a> alpha</span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" class="symbol">print</a> beta</span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" class="symbol">print</a> delta</span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" class="symbol">print</a> file</span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" class="symbol">print</a> free</span>)</span></span>)</span>
<span class="paren1">(<span class="nonparen">quit</span>)</span></span></div><p><pre>$ sample-script.lisp -affile.txt --beta -- file2.txt
-&gt; T
-&gt; T
-&gt; NIL
-&gt; &quot;file.txt&quot;
-&gt; (&quot;file2.txt&quot;)
$</pre><p>The repository is on github:
<a href="http://github.com/astine/unix-options">http://github.com/astine/unix-options</a><p><hr>
<a href="system&#32;programming.html" class="category">system programming</a> <a href="command-line&#32;options&#32;parser.html" class="category">command-line options parser</a></div></div>
<div id="footer" class="buttonbar"><ul><li><a href="unix-options.html">Current version</a></li>
<li><a href="https://www.cliki.net/site/history?article=unix-options">History</a></li>
<li><a href="https://www.cliki.net/site/backlinks?article=unix-options">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=unix-options&amp;from-revision=3686396666">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
</div>
<div id="header-buttons" class="buttonbar">
<ul>
<li><a href="https://www.cliki.net/">Home</a></li>
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
<li><a href="CLiki.html">About</a></li>
<li><a href="Text&#32;Formatting.html">Text Formatting</a></li>
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
</ul>
<div id="search">
<form action="https://www.cliki.net/site/search">
<label for="search_query" class="hidden">Search CLiki</label>
<input type="text" name="query" id="search_query" value="" />
<input type="submit" value="search" />
</form>
</div>
</div>
<div id="pageheader">
<div id="header">
<span id="logo">CLiki</span>
<span id="slogan">the common lisp wiki</span>
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
<label for="login_name" class="hidden">Account name</label>
<input type="text" name="name" id="login_name" class="login_input" />
<label for= "login_password" class="hidden">Password</label>
<input type="password" name="password" id="login_password" class="login_input" />
<input type="submit" name="login" value="login" id="login_submit" /><br />
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
</form>
</div>
</div>
</div>
</body></html>