Deploying upstream@0835c6d8ae075228e93cbe4beb3cf722b5fff884: Fix Now link to point to starfort
This commit is contained in:
@@ -308,12 +308,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -409,7 +409,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -582,6 +582,11 @@
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -597,11 +602,6 @@
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -564,6 +564,11 @@
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -579,11 +584,6 @@
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -624,6 +624,11 @@
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -639,11 +644,6 @@
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
content="2026-01-10">
|
||||
<meta
|
||||
property="og:article:modified_time"
|
||||
content="2026-01-10">
|
||||
content="2026-05-21">
|
||||
<meta
|
||||
property="og:article:author"
|
||||
content="Andrew Kesterson">
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -474,9 +474,9 @@
|
||||
id="section"
|
||||
class="post-content">
|
||||
<p>I’d like to present a C library I wrote for exception style error handling in C code, why I wrote it, and why I prefer this style of error handling when writing in the C language. </p>
|
||||
<p><a target="_blank" rel="noopener" href="https://github.com/akesterson/libakerror">libakerror: A safe exception handling library for C</a></p>
|
||||
<p><a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/libakerror">libakerror: A safe exception handling library for C</a></p>
|
||||
<p>To be clear, when I say “exception style error handling”, I am referring to the practice of one section of code creating an <code>exception</code> object, which is an object containing a rich error context, and then the language <code>raising</code> (or <code>throwing</code>) that exception up through the call stack, allowing all code paths in the call stack the opportunity to respond to that exception, and if the exception reaches all the way back up to the program’s top level without being handled, it will terminate the program.</p>
|
||||
<p>Before completing this article, I strongly recommend that you go and read <a target="_blank" rel="noopener" href="https://github.com/akesterson/libakerror/blob/main/README.md">the libakerror README</a>, at least the “Library Architecture” section. This article will not spend a lot of time explaining <strong>what</strong> libakerror does, or even <strong>how</strong> it does it, but rather <strong>why</strong> I prefer this style of error handling. So if you don’t go through the README, you may be a bit lost for the rest of the article.</p>
|
||||
<p>Before completing this article, I strongly recommend that you go and read <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/libakerror/blob/main/README.md">the libakerror README</a>, at least the “Library Architecture” section. This article will not spend a lot of time explaining <strong>what</strong> libakerror does, or even <strong>how</strong> it does it, but rather <strong>why</strong> I prefer this style of error handling. So if you don’t go through the README, you may be a bit lost for the rest of the article.</p>
|
||||
<center><img alt="Ill wait" src="/images/waiting-bear.webp"/></center>
|
||||
|
||||
<p>Note that the question of “why do you like writing software in C so much” won’t be answered here. That’s a separate blog post TBD. This post also assumes you are already familiar with the C programming language, although if you know any programming languages at all, you can probably get through it. If you don’t know C, I strongly recommend these two books:</p>
|
||||
@@ -771,7 +771,7 @@ ATTEMPT <span class="token punctuation">{</span>
|
||||
<p>Without good debug logs, a program is much more difficult to debug.</p>
|
||||
</blockquote>
|
||||
<p>I’ve spent the majority of my career working with software that runs in environments where the only hope for debugging it is to interrogate some log files after an error has already occurred. Getting the chance to attach a debugger and examine the state of the running program is a rare treat that we almost never get to experience in the DevSecOps world. So if a program does not emit useful logs, in my opinion, it is basically impossible to debug it in my world.</p>
|
||||
<p>And even when you have a debugger, a log is still a good way to quickly hone in on <em>where</em> something happened, even if you must take a much longer time to figure out <em>why</em> it happened. Let’s consider the code in <a target="_blank" rel="noopener" href="https://github.com/akesterson/libakerror/blob/main/tests/err_trace.c">one of the libakerror test programs</a>.</p>
|
||||
<p>And even when you have a debugger, a log is still a good way to quickly hone in on <em>where</em> something happened, even if you must take a much longer time to figure out <em>why</em> it happened. Let’s consider the code in <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/libakerror/blob/main/tests/err_trace.c">one of the libakerror test programs</a>.</p>
|
||||
<p>In this code, we have a call graph like <code>main() -> func1() -> func2()</code>. In <code>func2()</code> we experience some error that causes us to exit early. If we were to run this in naked C, it might look like this:</p>
|
||||
<pre class="line-numbers language-c" data-language="c"><code class="language-c"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string"><stdio.h></span></span>
|
||||
|
||||
@@ -1222,6 +1222,11 @@ _writeToFile_cleanup<span class="token operator">:</span>
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -1237,11 +1242,6 @@ _writeToFile_cleanup<span class="token operator">:</span>
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -599,6 +599,11 @@
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -614,11 +619,6 @@
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
content="2026-01-19">
|
||||
<meta
|
||||
property="og:article:modified_time"
|
||||
content="2026-01-19">
|
||||
content="2026-05-21">
|
||||
<meta
|
||||
property="og:article:author"
|
||||
content="Andrew Kesterson">
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -501,8 +501,8 @@
|
||||
<li>You might need to accept multiple values for a given argument and build a list. How do you do this? Do you accept a string with space separated items? Do you accept the same argument over and over? How do you store this in your script’s internal state?</li>
|
||||
</ul>
|
||||
<p>I feel the same way about bash that I do about C: it’s basically the perfect language for its domain (in bash’s case, gluing tasks together on a unix system). But this particular task in bash has always managed to really piss me off, because frankly, we can do so much better than what we are doing right now. This is one of the big reasons why people will abandon bash for the kinds of glue tasks it’s so good at, and move to something like <code>golang</code>, because there’s not a great interface between the user and the script for configuring options at runtime. Parsing arguments can be downright unfriendly to the user, in fact, let alone to the developer. It doesn’t have to be this way! There’s no reason why Java and Python and Ruby and Golang and <em>literally every other language out there</em> can have high quality argument parsing libraries but Bash can’t have them.</p>
|
||||
<p>So I wrote <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg">cmdarg</a>: A pure bash argument parsing library. This library solves all of the above problems you will suffer through in all of the above scenarios. Any time I need to add arguments to a bash script, I reach for this library, and I am always pleased with the result.</p>
|
||||
<h2 id="Declarative-Syntax-for-Clear-Interfaces"><a href="#Declarative-Syntax-for-Clear-Interfaces" class="headerlink" title="Declarative Syntax for Clear Interfaces"></a>Declarative Syntax for Clear Interfaces</h2><p><a target="_blank" rel="noopener" href="https://github.com/akesteron/cmdarg">Cmdarg</a> wants to help you build a clear interface to your script without asking you to write any of the parsing code. You want to write your script - you don’t want to write argument parsing code. So cmdarg allows you to <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg?tab=readme-ov-file#cmdarg-1">declare the interface</a>, <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg?tab=readme-ov-file#cmdarg_parse">parse the arguments</a>, and <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg?tab=readme-ov-file#tldr">get on with using the values in your script</a>. Cmdarg assumes your script will take 0 or more command line arguments, and each one of these arguments will have:</p>
|
||||
<p>So I wrote <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg">cmdarg</a>: A pure bash argument parsing library. This library solves all of the above problems you will suffer through in all of the above scenarios. Any time I need to add arguments to a bash script, I reach for this library, and I am always pleased with the result.</p>
|
||||
<h2 id="Declarative-Syntax-for-Clear-Interfaces"><a href="#Declarative-Syntax-for-Clear-Interfaces" class="headerlink" title="Declarative Syntax for Clear Interfaces"></a>Declarative Syntax for Clear Interfaces</h2><p><a target="_blank" rel="noopener" href="https://github.com/akesteron/cmdarg">Cmdarg</a> wants to help you build a clear interface to your script without asking you to write any of the parsing code. You want to write your script - you don’t want to write argument parsing code. So cmdarg allows you to <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg#cmdarg-1">declare the interface</a>, <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg#cmdarg_parse">parse the arguments</a>, and <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg#tldr">get on with using the values in your script</a>. Cmdarg assumes your script will take 0 or more command line arguments, and each one of these arguments will have:</p>
|
||||
<ul>
|
||||
<li>A name</li>
|
||||
<li>A type, including whether or not the argument is required or optional</li>
|
||||
@@ -629,13 +629,13 @@ argv =>
|
||||
3 => -m
|
||||
4 => --some_thing<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
|
||||
|
||||
<h2 id="There’s-more-Go-read-the-README"><a href="#There’s-more-Go-read-the-README" class="headerlink" title="There’s more. Go read the README"></a>There’s more. Go read the README</h2><p>I’m not going to repeat the entirety of the README here, so <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg/">go find out for yourself</a> about:</p>
|
||||
<h2 id="There’s-more-Go-read-the-README"><a href="#There’s-more-Go-read-the-README" class="headerlink" title="There’s more. Go read the README"></a>There’s more. Go read the README</h2><p>I’m not going to repeat the entirety of the README here, so <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg/">go find out for yourself</a> about:</p>
|
||||
<ul>
|
||||
<li>Using <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg?tab=readme-ov-file#validators">validator functions</a> to validate user input on the arguments (including key names on map options)</li>
|
||||
<li>Using <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg?tab=readme-ov-file#helpers">helper functions</a> to control how arguments are described and how usage (<code>--help</code>) messages are constructed/printed</li>
|
||||
<li>Using <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg?tab=readme-ov-file#controlling-cmdargs-behavior-on-error">custom error handlers</a> to control what happens when the parser encounters an error in user input</li>
|
||||
<li>Using <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg#validators">validator functions</a> to validate user input on the arguments (including key names on map options)</li>
|
||||
<li>Using <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg#helpers">helper functions</a> to control how arguments are described and how usage (<code>--help</code>) messages are constructed/printed</li>
|
||||
<li>Using <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg#controlling-cmdargs-behavior-on-error">custom error handlers</a> to control what happens when the parser encounters an error in user input</li>
|
||||
</ul>
|
||||
<h2 id="Why-I-still-use-this-almost-two-decades-later"><a href="#Why-I-still-use-this-almost-two-decades-later" class="headerlink" title="Why I still use this almost two decades later"></a>Why I still use this almost two decades later</h2><p>A lot can change in 15 years. <a target="_blank" rel="noopener" href="https://github.com/akesterson/cmdarg/">cmdarg</a> is not the only game in town anymore. So why am I still using something I wrote 15 years ago? Well obviously I know this one, because I wrote it, so that’s an easy win. But also because, in 15 years, I have yet to find another library that meets all these requirements:</p>
|
||||
<h2 id="Why-I-still-use-this-almost-two-decades-later"><a href="#Why-I-still-use-this-almost-two-decades-later" class="headerlink" title="Why I still use this almost two decades later"></a>Why I still use this almost two decades later</h2><p>A lot can change in 15 years. <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/cmdarg/">cmdarg</a> is not the only game in town anymore. So why am I still using something I wrote 15 years ago? Well obviously I know this one, because I wrote it, so that’s an easy win. But also because, in 15 years, I have yet to find another library that meets all these requirements:</p>
|
||||
<ul>
|
||||
<li>Written purely in bash. Some contemporaries <a target="_blank" rel="noopener" href="https://github.com/nhoffman/argparse-bash">actually call some other language like python behind your back</a>. Others <a target="_blank" rel="noopener" href="https://github.com/matejak/argbash/tree/master">rely on some complicated preprocessor</a> that compiles your script down into a new script.</li>
|
||||
<li>Generate help messages that sufficiently document usage for the user, including all flags, optional vs required, array inputs, copyright, etc. Some contemporaries do this, but the formatting is kinda gross. Others simply omit it and still expect you to do it.</li>
|
||||
@@ -755,6 +755,11 @@ Options:
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -770,11 +775,6 @@ Options:
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -623,6 +623,11 @@ Computers simulate determinism; only Tao is perfect."<br/>
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -638,11 +643,6 @@ Computers simulate determinism; only Tao is perfect."<br/>
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -644,6 +644,11 @@ Thus spake the Master Programmer:<br/><br/>
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -659,11 +664,6 @@ Thus spake the Master Programmer:<br/><br/>
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -655,6 +655,11 @@
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -670,11 +675,6 @@
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user