example.html 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head>
  6. <!-- 2024-01-27 Sat 11:58 -->
  7. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1" />
  9. <title>Example</title>
  10. <meta name="author" content="Joshua Branson" />
  11. <meta name="generator" content="Org Mode" />
  12. <link rel="stylesheet" href="../css/normalize.css" type="text/css"/><link rel="stylesheet" href="../css/default-org-stylesheet.css" type="text/css"/><link rel="stylesheet" href="../css/stylesheet.css" type="text/css"/>
  13. </head>
  14. <body>
  15. <div id="preamble" class="status">
  16. <nav><a href="../index.html">Home</a><a href="../about.html">About</a><a href="../blog/index.html">Blog</a></nav>
  17. </div>
  18. <div id="content" class="content">
  19. <h1 class="title">Example</h1>
  20. <div id="outline-container-orgf9f62ea" class="outline-2">
  21. <h2 id="orgf9f62ea"><span class="todo TODO">TODO</span> fix Path math everywhere</h2>
  22. <div class="outline-text-2" id="text-orgf9f62ea">
  23. <div class="org-src-container">
  24. <pre class="src src-C"><span style="font-weight: bold;">#include</span> <span style="font-style: italic;">&lt;stdio.h&gt;</span>
  25. <span style="font-weight: bold;">#define</span> <span style="font-weight: bold; font-style: italic;">PATH_MAX</span> <span style="font-style: italic;">"evil"</span>
  26. <span style="font-weight: bold; text-decoration: underline;">int</span> <span style="font-weight: bold;">main</span> () {
  27. <span style="font-weight: bold;">return</span> 0;
  28. }
  29. </pre>
  30. </div>
  31. </div>
  32. <div id="outline-container-org7061b96" class="outline-3">
  33. <h3 id="org7061b96"><span class="done DONE">DONE</span> convince the Guix people to use scheme everywhere&#xa0;&#xa0;&#xa0;<span class="tag"><span class="scheme">scheme</span></span></h3>
  34. <div class="outline-text-3" id="text-org7061b96">
  35. <div class="org-src-container">
  36. <pre class="src src-scheme">(<span style="font-weight: bold;">define</span> (<span style="font-weight: bold;">main</span> args)
  37. <span style="font-weight: bold; font-style: italic;">;;</span><span style="font-weight: bold; font-style: italic;">the option specification tells getopt-long how</span>
  38. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">to parse the command line</span>
  39. (<span style="font-weight: bold;">let*</span> ((option-spec '((version (single-char #\v) (value #f))
  40. (help (single-char #\h) (value #f))
  41. (calc (single-char #\c) (value #t)
  42. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(required #t)</span>
  43. )))
  44. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">tell getopt-long to parse the command line and put the</span>
  45. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">data in options</span>
  46. (options (getopt-long args option-spec))
  47. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">was --help or -h used?</span>
  48. (help-wanted (option-ref options 'help #f))
  49. (version-wanted (option-ref options 'version #f))
  50. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">was -c or --calc used? If there was no value given,</span>
  51. <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">then return #f</span>
  52. (calc-wanted (option-ref options '() #f)))
  53. (<span style="font-weight: bold;">if</span> (<span style="font-weight: bold;">or</span> version-wanted help-wanted)
  54. (<span style="font-weight: bold;">cond</span>
  55. (help-wanted
  56. (display <span style="font-style: italic;">"calc [options]\n"</span>)
  57. (display <span style="font-style: italic;">"-v --version Display version\n"</span>)
  58. (display <span style="font-style: italic;">"-h, --help Display this help info\n"</span>))
  59. (version-wanted
  60. (display <span style="font-style: italic;">"calc version 0.1\n"</span>)))
  61. (display calc-wanted))))
  62. </pre>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div id="postamble" class="status">
  69. <p class="date">Date: 2024-01-25 Thu 16:00</p>
  70. <p class="author">Author: Joshua Branson</p>
  71. <p class="date">Created: 2024-01-27 Sat 11:58</p>
  72. <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
  73. </div>
  74. </body>
  75. </html>