<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dimitri Gilbert</title>
    <description>The latest articles on DEV Community by Dimitri Gilbert (@dimitrigilbert).</description>
    <link>https://dev.to/dimitrigilbert</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F136697%2F600eef6f-c614-4af9-8c5d-f5a48ee9499b.png</url>
      <title>DEV Community: Dimitri Gilbert</title>
      <link>https://dev.to/dimitrigilbert</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dimitrigilbert"/>
    <language>en</language>
    <item>
      <title>ParseArger, completion, documentation and stuff</title>
      <dc:creator>Dimitri Gilbert</dc:creator>
      <pubDate>Wed, 08 Nov 2023 22:39:02 +0000</pubDate>
      <link>https://dev.to/dimitrigilbert/parsearger-completion-documentation-and-stuff-4kd7</link>
      <guid>https://dev.to/dimitrigilbert/parsearger-completion-documentation-and-stuff-4kd7</guid>
      <description>&lt;p&gt;Now that you can &lt;a href="https://dbuild.io/projects/parsearger/generate-and-parse/"&gt;generate and parse&lt;/a&gt; scripts with &lt;a href="https://dbuild.io/projects/parsearger/more-on-pos-opt-and-flag/"&gt;fine tuned arguments, options and flags&lt;/a&gt;, we are going to generate supporting stuff for our scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Completion
&lt;/h2&gt;

&lt;p&gt;Completion is a great feature of the terminal that allows you to complete commands, options and arguments by pressing the tab key. It is a great way to avoid typos and to discover new commands and options. For me, it is the main selling point on why you should use the terminal. I use completely, so you have to install it before generating the completion script, but the script itself is standalone. Here comes the help :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  command-name: command-name
  file: file
  &lt;span class="nt"&gt;--subcommand-directory&lt;/span&gt;|--subcmd-dir &amp;lt;subcommand-directory&amp;gt;: directory &lt;span class="k"&gt;for &lt;/span&gt;subcommand target
  &lt;span class="nt"&gt;--completely-cmd&lt;/span&gt;|--cmpcmd &amp;lt;completely-cmd&amp;gt;: completely &lt;span class="nb"&gt;command&lt;/span&gt;, repeatable
  &lt;span class="nt"&gt;--extra-file&lt;/span&gt; &amp;lt;extra-file&amp;gt;: extra yaml declaration, repeatable
  &lt;span class="nt"&gt;--yaml-file&lt;/span&gt; &amp;lt;yaml-file&amp;gt;: yaml file name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' completely.yaml '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--completion-file&lt;/span&gt; &amp;lt;completion-file&amp;gt;: completion file name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' completely.bash '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--run-completely&lt;/span&gt;|--no-run-completely: run completely, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-run-completely&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
          no-aliases: &lt;span class="nt"&gt;--no-run&lt;/span&gt;,
  &lt;span class="nt"&gt;--discover-subcommand&lt;/span&gt;|--no-discover-subcommand: auto run completely on found subcommand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s have a look a few examples :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# generate completion for my-script&lt;/span&gt;
parseArger completely my-script &lt;span class="s2"&gt;"./my-script"&lt;/span&gt;

&lt;span class="c"&gt;# generate completion for my-script and its subcommand in the ./bin directory&lt;/span&gt;
parseArger completely my-script &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--subcommand-directory&lt;/span&gt; &lt;span class="s2"&gt;"./bin"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sometimes, for some esotheric reason, it does not work, but I found a work around :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# generate completion definition for completely&lt;/span&gt;
parseArger completely my-script &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--no-run-completely&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; completely.yaml
&lt;span class="c"&gt;# run completely preview (that does work) and put the output in the completion script file&lt;/span&gt;
completely preview &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; completely.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  command-name
&lt;/h3&gt;

&lt;p&gt;The command you generate the completion for&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  file
&lt;/h3&gt;

&lt;p&gt;The executable file for command-name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –subcommand-directory
&lt;/h3&gt;

&lt;p&gt;If your command has subcommands, you can specify the directory where they are located so it will generate the completion as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--subcommand-directory&lt;/span&gt; ./bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –completely-cmd
&lt;/h3&gt;

&lt;p&gt;Completely is not installed inyour path ? It runs as a container ? That’s ok, you can specify the command to run completely.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--completely-cmd&lt;/span&gt; &lt;span class="s2"&gt;"docker run --rm -it completely"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –extra-file
&lt;/h3&gt;

&lt;p&gt;The completion is generated from the arguments options and flags you defined in your script, but you can concatenate other yaml files to add more completion.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--extra-file&lt;/span&gt; ./my-script.completion.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –yaml-file
&lt;/h3&gt;

&lt;p&gt;If the yaml file name does not suit you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--yaml-file&lt;/span&gt; ./not-completely.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –completion-file
&lt;/h3&gt;

&lt;p&gt;Same as for the yaml file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--completion-file&lt;/span&gt; ./not-completely.bash

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]run-completely
&lt;/h3&gt;

&lt;p&gt;Output the yaml file to stdout&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--no-run-completely&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]discover-subcommand
&lt;/h3&gt;

&lt;p&gt;If you have subcommands, you can generate the completion for them as well, but you don’t have to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script &lt;span class="nt"&gt;--no-discover-subcommand&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;making things is coll, but making so that others (or you, after a while) can use whatever you put out there is even cooler. But it is also very long and boring. So I made a tool to do some of it for me. I don’t use the output as is but it’s a good starting point ;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nt"&gt;-f&lt;/span&gt;, &lt;span class="nt"&gt;--file&lt;/span&gt; &amp;lt;file&amp;gt;: file to document, repeatable
  &lt;span class="nt"&gt;-d&lt;/span&gt;, &lt;span class="nt"&gt;--directory&lt;/span&gt;|--folder &amp;lt;directory&amp;gt;: directory to document, repeatable
  &lt;span class="nt"&gt;-o&lt;/span&gt;, &lt;span class="nt"&gt;--out&lt;/span&gt; &amp;lt;out&amp;gt;: output file
  &lt;span class="nt"&gt;--tag&lt;/span&gt; &amp;lt;tag&amp;gt;: markdown tag &lt;span class="k"&gt;for &lt;/span&gt;title &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' ## '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--next-tag-prepend&lt;/span&gt; &amp;lt;next-tag-prepend&amp;gt;: prepend to next title tag level &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' # '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--title&lt;/span&gt; &amp;lt;title&amp;gt;: documentation title &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' Usage '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--title-tag&lt;/span&gt; &amp;lt;title-tag&amp;gt;: documentation title tag &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' # '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--sub-directory&lt;/span&gt;|--no-sub-directory: document subdirectory, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-sub-directory&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;--append-output&lt;/span&gt;|--no-append-output: add to output file &lt;span class="k"&gt;if &lt;/span&gt;it exists, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-append-output&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and a few examples :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# generate completion for my-script&lt;/span&gt;
parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--out&lt;/span&gt; &lt;span class="s2"&gt;"./my-script documentation.md"&lt;/span&gt;

&lt;span class="c"&gt;# generate completion for my-script and all the scripts in the ./bin directory, erase "my-script documentatino.md" if it exists&lt;/span&gt;
parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--directory&lt;/span&gt; &lt;span class="s2"&gt;"./bin"&lt;/span&gt; &lt;span class="nt"&gt;--out&lt;/span&gt; &lt;span class="s2"&gt;"./my-script documentation.md"&lt;/span&gt; &lt;span class="nt"&gt;--no-append-output&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –file
&lt;/h3&gt;

&lt;p&gt;Document this file, repeatable. First in first out.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# generate completion for my-script and my-other-script&lt;/span&gt;
parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-other-script"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –directory
&lt;/h3&gt;

&lt;p&gt;Document all parseArger scripts in this directory, repeatable. First in first out.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# generate completion for all the scripts in the ./bin and ./I/put/stuff/every/where directories&lt;/span&gt;
parseArger document &lt;span class="nt"&gt;--directory&lt;/span&gt; &lt;span class="s2"&gt;"./bin"&lt;/span&gt; &lt;span class="nt"&gt;--directory&lt;/span&gt; &lt;span class="s2"&gt;"./I/put/stuff/every/where"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –out
&lt;/h3&gt;

&lt;p&gt;If not specified, I will barf all over stdout !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# generate completion output to stdout&lt;/span&gt;
parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt;
&lt;span class="c"&gt;# generate completion output to documentation.md&lt;/span&gt;
parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--out&lt;/span&gt; &lt;span class="s2"&gt;"./documentation.md"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –tag
&lt;/h3&gt;

&lt;p&gt;I shall use a tag for titles, default is ##. But you know, if youd rather have h6, you can do that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--tag&lt;/span&gt; &lt;span class="s2"&gt;"######"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –next-tag-prepend
&lt;/h3&gt;

&lt;p&gt;I start taggin with –tag value, but for each subsequent title, I prepend this value to the tag. Default is #.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--next-tag-prepend&lt;/span&gt; &lt;span class="s2"&gt;"######"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –title
&lt;/h3&gt;

&lt;p&gt;If you wanna get fancy with your title, otherwise you’ll get a boring Usage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"How to use my script"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –title-tag
&lt;/h3&gt;

&lt;p&gt;I already have an h1 bladi bladi blada, whatever …!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--title-tag&lt;/span&gt; &lt;span class="s2"&gt;"###"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]sub-directory
&lt;/h3&gt;

&lt;p&gt;If you ain’t tellin’ me, I’ll go though your stuff !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document &lt;span class="nt"&gt;--directory&lt;/span&gt; &lt;span class="s2"&gt;"./bin"&lt;/span&gt; &lt;span class="nt"&gt;--no-sub-directory&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]append-output
&lt;/h3&gt;

&lt;p&gt;That is usually how I clean, using a black hole !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document &lt;span class="nt"&gt;--file&lt;/span&gt; &lt;span class="s2"&gt;"./my-script"&lt;/span&gt; &lt;span class="nt"&gt;--out&lt;/span&gt; &lt;span class="s2"&gt;"./documentation.md"&lt;/span&gt; &lt;span class="nt"&gt;--no-append-output&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  HTML form
&lt;/h2&gt;

&lt;p&gt;Wait, what ?!! Why would a bash CLI script need a form ? Well, it doesn’t, but I had the idea of using them for documentation purposes. They come bundled with some (very dirty) javascript to generate a command from the input so less terminally inclined people can take advantage of your tools too (and maybe, just maybe learn to appreciate it ;) ).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  file: file to process
  &lt;span class="nt"&gt;--command&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: &lt;span class="nb"&gt;command &lt;/span&gt;string, default to file 
  &lt;span class="nt"&gt;--action&lt;/span&gt; &amp;lt;action&amp;gt;: form action
  &lt;span class="nt"&gt;--form-class&lt;/span&gt; &amp;lt;form-class&amp;gt;: form html class
  &lt;span class="nt"&gt;--input-container-class&lt;/span&gt; &amp;lt;input-container-class&amp;gt;: input container class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-group '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--input-class&lt;/span&gt; &amp;lt;input-class&amp;gt;: input class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-control '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--label-class&lt;/span&gt; &amp;lt;label-class&amp;gt;: label class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-label '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--select-class&lt;/span&gt; &amp;lt;&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="nt"&gt;-class&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: &lt;span class="k"&gt;select &lt;/span&gt;class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-select '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--checkbox-container-class&lt;/span&gt;|--radio-container-class &amp;lt;checkbox-container-class&amp;gt;: checkbox and radio class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-check '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--checkbox-class&lt;/span&gt;|--radio-class &amp;lt;checkbox-class&amp;gt;: checkbox and radio class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-check-input '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--checkbox-label-class&lt;/span&gt;|--radio-label-class &amp;lt;checkbox-label-class&amp;gt;: checkbox and radio label class &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' form-check-label '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nt"&gt;--parent-form&lt;/span&gt; &amp;lt;parent-form&amp;gt;: parent form &lt;span class="k"&gt;for &lt;/span&gt;result
  &lt;span class="nt"&gt;--form&lt;/span&gt;|--no-form: display form, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-form&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;--button&lt;/span&gt;|--no-button: display button, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-button&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;--js&lt;/span&gt;|--no-js: create javascript, &lt;span class="nt"&gt;--no-js&lt;/span&gt; forces &lt;span class="nt"&gt;--no-result&lt;/span&gt;, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-js&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;--result&lt;/span&gt;|--no-result: display result, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-result&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  file
&lt;/h3&gt;

&lt;p&gt;A simple form for a simple file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –command
&lt;/h3&gt;

&lt;p&gt;If your filename do not match the command you want to run (for alias reasons), you can specify it here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# when you do not want to keep things simple&lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--command&lt;/span&gt; &lt;span class="s2"&gt;"my-script-alias"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –action
&lt;/h3&gt;

&lt;p&gt;The form does not go anywhere by default, but you can change that !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Where I want to go&lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"/over/the/rainbow"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –form-class
&lt;/h3&gt;

&lt;p&gt;The form uses bootstrap classes by default so it’s easy and quick to make them pretty. I won’t repeat it, but it goes for all *-class options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Me no like bootstrap !&lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--form-class&lt;/span&gt; &lt;span class="s2"&gt;"my-form-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –input-container-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--input-container-class&lt;/span&gt; &lt;span class="s2"&gt;"my-input-container-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –input-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--input-class&lt;/span&gt; &lt;span class="s2"&gt;"my-input-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –label-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--label-class&lt;/span&gt; &lt;span class="s2"&gt;"my-label-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –select-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--select-class&lt;/span&gt; &lt;span class="s2"&gt;"my-select-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –checkbox-container-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script  &lt;span class="nt"&gt;--checkbox-container-class&lt;/span&gt; &lt;span class="s2"&gt;"my-checkbox-container-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –checkbox-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--checkbox-class&lt;/span&gt; &lt;span class="s2"&gt;"my-checkbox-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –checkbox-label-class
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--checkbox-label-class&lt;/span&gt; &lt;span class="s2"&gt;"my-checkbox-label-class"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –parent-form
&lt;/h3&gt;

&lt;p&gt;When you have sub commands, forms nest into one-another. You can specify the parent form id here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--parent-form&lt;/span&gt; &lt;span class="s2"&gt;"my-parent-form"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –form
&lt;/h3&gt;

&lt;p&gt;Then main form id&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--form&lt;/span&gt; &lt;span class="s2"&gt;"my-form"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]button
&lt;/h3&gt;

&lt;p&gt;On by default, –no- to not create a button&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--no-button&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]js
&lt;/h3&gt;

&lt;p&gt;On by default, –no- to not create javascript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--no-js&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  –[no-]result
&lt;/h3&gt;

&lt;p&gt;On by default, –no- to not show results&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# &lt;/span&gt;
parseArger html-form my-script &lt;span class="nt"&gt;--no-result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What now ?
&lt;/h2&gt;

&lt;p&gt;Completion scripts and documentions are a waiting ! You can now more than ever make your bash tools even more awesome (or useful, but who cares about that, uh ? ;) ) ! And if you get so inclined as create a GUI for your script, you have a starting point with the html form (I never said it was a good one ^^). As always bugs and suggestions should go on parseArger’s github repo.&lt;/p&gt;

&lt;p&gt;Thanks for the read and I hope you found it useful (or at least entertaining :D )&lt;/p&gt;

&lt;p&gt;See you around and happy coding !&lt;/p&gt;

</description>
      <category>bash</category>
      <category>terminal</category>
      <category>linux</category>
      <category>cli</category>
    </item>
    <item>
      <title>ParseArger deeper: --pos --opt and --flag</title>
      <dc:creator>Dimitri Gilbert</dc:creator>
      <pubDate>Thu, 26 Oct 2023 09:51:11 +0000</pubDate>
      <link>https://dev.to/dimitrigilbert/parsearger-deeper-pos-opt-and-flag-37nc</link>
      <guid>https://dev.to/dimitrigilbert/parsearger-deeper-pos-opt-and-flag-37nc</guid>
      <description>&lt;p&gt;Now that you know the basic of parseArger &lt;code&gt;generate&lt;/code&gt; and &lt;code&gt;parse&lt;/code&gt;, it's time to have a look at how we declare arguments, options and flags !&lt;/p&gt;

&lt;h2&gt;
  
  
  --pos
&lt;/h2&gt;

&lt;p&gt;Positional arguments are what most of us use in a bash script with &lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt;, &lt;code&gt;$...&lt;/code&gt;&lt;br&gt;
Well same thing here, but they have names And much more :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;arg-name: positional argument name
description: positional argument description
&lt;span class="nt"&gt;--one-of&lt;/span&gt; &amp;lt;one-of&amp;gt;: accepted values, repeatable
&lt;span class="nt"&gt;--complete&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;complete&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: bash built-in completely &lt;span class="k"&gt;function&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;--complete-custom&lt;/span&gt; &amp;lt;complete-custom&amp;gt;: completely custom dynamic suggestion, repeatable
&lt;span class="nt"&gt;--subcommand-directory&lt;/span&gt; &amp;lt;subcommand-directory&amp;gt;: directory containing subcommands, force subcommand, list parseArger script &lt;span class="k"&gt;in &lt;/span&gt;directory to fill &lt;span class="nt"&gt;--one-of&lt;/span&gt;
&lt;span class="nt"&gt;--subcommand-variable&lt;/span&gt; &amp;lt;subcommand-variable&amp;gt;: array variable containing subcommand parts, force subcommand &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' __subcommand '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--subcommand&lt;/span&gt;|--no-subcommand: is a subcommand
&lt;span class="nt"&gt;--subcommand-run&lt;/span&gt;|--no-subcommand-run: run subcommand, forces sub &lt;span class="nb"&gt;command&lt;/span&gt;
&lt;span class="nt"&gt;--subcommand-use-leftovers&lt;/span&gt;|--no-subcommand-use-leftovers: add leftover arguments to subcommand, forces subcommand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a dumb example that generates a script that take one argument my-cmd and execute it as a subcommand using the leftover arguments, my-cmd must be one of "ls", "cd" or "cat" :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s1"&gt;'my-cmd "an argument" --subcommand --subcommand-run --subcommand-use-leftovers --one-of ls --one-of cd --one-of cat'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  arg-name
&lt;/h3&gt;

&lt;p&gt;The argument name, &lt;code&gt;-&lt;/code&gt; will be replaced with &lt;code&gt;_&lt;/code&gt; and the variable will be prefixed with &lt;code&gt;_arg_&lt;/code&gt;.&lt;br&gt;
So --my-super-argument value is assigned to $_arg_my_super_argument.&lt;/p&gt;
&lt;h3&gt;
  
  
  description
&lt;/h3&gt;

&lt;p&gt;Simple description for help, documentation and so on&lt;/p&gt;
&lt;h3&gt;
  
  
  --one-of
&lt;/h3&gt;

&lt;p&gt;Repeatable, The argument value must be one of, the most basic input validation, yeah !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "my argument description" --one-of value1 --one-of value2'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --complete
&lt;/h3&gt;

&lt;p&gt;Repeatable, &lt;a href="https://github.com/DannyBen/completely#suggesting-files-directories-and-other-bash-built-ins"&gt;Completely built-ins&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-file "this is a file path" --complete file'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --complete-custom
&lt;/h3&gt;

&lt;p&gt;Repeatable, &lt;a href="https://github.com/DannyBen/completely#suggesting-custom-dynamic-suggestions"&gt;Completely custom&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "this is an argument" --complete-custom "\$(echo \"some_value some_other you_get the_point\")"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --subcommand-directory
&lt;/h3&gt;

&lt;p&gt;You been a good kid and you did split your scripts ?&lt;br&gt;
If they're all in the subcommand-directory, parseArger will add them to one of and build a __subcommand variable for you to use.&lt;br&gt;
It forces --subcommand ... in case you were wondering.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "this is an argument" --subcommand-directory bin'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --subcommand-variable
&lt;/h3&gt;

&lt;p&gt;Ooooh, oh you don't like __subcommand !!? What should it be called then ? It forces --subcommand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "this is an argument" --subcommand-variable notAsubCommand'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --subcommand
&lt;/h3&gt;

&lt;p&gt;This is a subcommand&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "this is a command argument" --subcommand'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --subcommand-run
&lt;/h3&gt;

&lt;p&gt;Run the subcommand before handing you the script, forces --subcommand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "this is an argument" --subcommand-run'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --subcommand-use-leftovers
&lt;/h3&gt;

&lt;p&gt;Maybe those leftovers are worth something..., after all ! Forces --subcommand&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "this is an argument" --subcommand-use-leftovers
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  --opt
&lt;/h2&gt;

&lt;p&gt;I'm pretty sure most of you were waiting for that : (add ethereal music here) options !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;arg-name: positional argument name
description: positional argument description
&lt;span class="nt"&gt;--repeat-min&lt;/span&gt; &amp;lt;repeat-min&amp;gt;: minimum repeatition forces repeat &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' 1 '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--repeat-max&lt;/span&gt; &amp;lt;repeat-max&amp;gt;: maximum repeatition forces repeat
&lt;span class="nt"&gt;--one-of&lt;/span&gt; &amp;lt;one-of&amp;gt;: accepted values, repeatable
&lt;span class="nt"&gt;-d&lt;/span&gt;, &lt;span class="nt"&gt;--default-value&lt;/span&gt; &amp;lt;default-value&amp;gt;: value, repeatable
&lt;span class="nt"&gt;-s&lt;/span&gt;, &lt;span class="nt"&gt;--short&lt;/span&gt; &amp;lt;short&amp;gt;: short form
&lt;span class="nt"&gt;--alias&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: option &lt;span class="nb"&gt;alias&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;--empty-value&lt;/span&gt; &amp;lt;empty-value&amp;gt;: value &lt;span class="k"&gt;for &lt;/span&gt;empty option
&lt;span class="nt"&gt;--complete&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;complete&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: bash built-in completely &lt;span class="k"&gt;function&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;--complete-custom&lt;/span&gt; &amp;lt;complete-custom&amp;gt;: completely custom dynamic suggestion, repeatable
&lt;span class="nt"&gt;-r&lt;/span&gt;|--repeat|--no-repeat: repeatable
&lt;span class="nt"&gt;--empty&lt;/span&gt;|--no-empty: use option as flag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I won't bore you with arg-name and description, and if you need me too, you might want to re read the previous part a tiny tad more attentively, maybe, if you'd like to.&lt;/p&gt;

&lt;h3&gt;
  
  
  --repeat-min
&lt;/h3&gt;

&lt;p&gt;Repeatable option, yes ! but at least this many ! Forces --repeat.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "this is an option" --repeat-min 42
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --repeat-max
&lt;/h3&gt;

&lt;p&gt;Repeatable option, yes ! but not too much ! Forces --repeat.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "this is an option" --repeat-max 69
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --one-of
&lt;/h3&gt;

&lt;p&gt;see --pos --one-of above, it's the same ;)&lt;/p&gt;

&lt;h3&gt;
  
  
  --default-value
&lt;/h3&gt;

&lt;p&gt;An option, why not, but it shall not be empty !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "musnt be eeeemmmmpty" --default-value "this is not empty"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --short
&lt;/h3&gt;

&lt;p&gt;I know ya'll concerned about bodily efficiency (my mom called that "lazy"...), letters matters ! you got 26 of'em, that's how many options max my scripts have !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "lazily call me" --short o'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --alias
&lt;/h3&gt;

&lt;p&gt;I know it's hard to always agree (especially with yourself !), with aliases, no more decision (about option names), you can have your cake, and eat it, too !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'a-opt "lazily call me" --alias "an-opt" --alias "an-option" --alias "needlessly-long-option-name"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --short
&lt;/h3&gt;

&lt;p&gt;I know ya'll concerned about bodily efficiency (my mom called that "lazy"...), letters matters ! you got 26 of'em, that's how many options max my scripts have !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "lazily call me" --short o'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --complete
&lt;/h3&gt;

&lt;p&gt;see --pos --complete above, it's the same ;)&lt;/p&gt;

&lt;h3&gt;
  
  
  --complete-custom
&lt;/h3&gt;

&lt;p&gt;see --pos --complete-custom above, it's the same ;)&lt;/p&gt;

&lt;h3&gt;
  
  
  --repeat
&lt;/h3&gt;

&lt;p&gt;You can now have multiple values for your option. the option is now an array, even if only one value is given.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "look ma'&lt;/span&gt;, I&lt;span class="s1"&gt;'am an array !" --repeat'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --empty
&lt;/h3&gt;

&lt;p&gt;Option or flag ? Well, why not both ? A flag if you don't give it anything, an option otherwise !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-opt "option&amp;gt;flag superposition" --empty'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  --flag
&lt;/h2&gt;

&lt;p&gt;Ahoy ! raise the flaaaaaag ! (I'd say I'm grasping at branches, but it seems tree do not grow in the ocean...)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;arg-name: positional argument name
description: positional argument description
&lt;span class="nt"&gt;-s&lt;/span&gt;, &lt;span class="nt"&gt;--short&lt;/span&gt; &amp;lt;short&amp;gt;: short form
&lt;span class="nt"&gt;--no-name&lt;/span&gt; &amp;lt;no-name&amp;gt;: value &lt;span class="k"&gt;for &lt;/span&gt;the negation
&lt;span class="nt"&gt;--alias&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: flag &lt;span class="nb"&gt;alias&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;--no-alias&lt;/span&gt; &amp;lt;no-alias&amp;gt;: flag negation &lt;span class="nb"&gt;alias&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;--on&lt;/span&gt;|--no-on: on by default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You know the drill with arg-name, description, --short and alias, it's up above ;)&lt;/p&gt;

&lt;h3&gt;
  
  
  --no-name
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;--no-&amp;lt;flag-name&amp;gt;&lt;/code&gt; do not fly ? Fine, you choose !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--flag&lt;/span&gt; &lt;span class="s1"&gt;'do-that "flabbergasted, flag a..." --no-name dont-do-that'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --no-alias
&lt;/h3&gt;

&lt;p&gt;There are plenty of ways to say no !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--flag&lt;/span&gt; &lt;span class="s1"&gt;'do-that "flabbergasted, flag a..." --no-alias this-instead --no-alias do-this'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --on
&lt;/h3&gt;

&lt;p&gt;It's already on... but you can turn it off.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--flag&lt;/span&gt; &lt;span class="s1"&gt;'do-that "flabbergasted, flag a..." --on'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What now ?
&lt;/h2&gt;

&lt;p&gt;Now you almost have the whole view on parseArger, enough for simple scripts anyway !&lt;br&gt;
But maybe you do not value your mental health much and would like to create a whole program in bash ?&lt;br&gt;
Well, What a coincidence, next time we'll have a look at the &lt;code&gt;project&lt;/code&gt; command, it'll help you do just that ! (the program part, I do not deal in mental health)&lt;br&gt;
As always bugs and suggestions should go on &lt;a href="https://github.com/DimitriGilbert/parseArger"&gt;parseArger's github repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for the read and I hope you found it useful (or at least entertaining :D )&lt;/p&gt;

&lt;p&gt;See you around and happy coding !&lt;/p&gt;

</description>
      <category>bash</category>
      <category>cli</category>
      <category>linux</category>
      <category>terminal</category>
    </item>
    <item>
      <title>ParseArger : create bash scripts you'll want to use</title>
      <dc:creator>Dimitri Gilbert</dc:creator>
      <pubDate>Sun, 08 Oct 2023 12:33:11 +0000</pubDate>
      <link>https://dev.to/dimitrigilbert/parsearger-create-bash-scripts-youll-want-to-use-3o99</link>
      <guid>https://dev.to/dimitrigilbert/parsearger-create-bash-scripts-youll-want-to-use-3o99</guid>
      <description>&lt;p&gt;So, who here writes &lt;strong&gt;bash&lt;/strong&gt; scripts ? And among these scripts, some take arguments, right ? &lt;br&gt;
Ok ok, so, get me any kind of documentation, usage hint or anything, like, right NOW !&lt;/p&gt;

&lt;p&gt;Yeah...it's ok, we've all been there, and if you didn't, you might (not) have had a look at &lt;a href="https://stackoverflow.com/a/14203146"&gt;parsing&lt;/a&gt; arguments and (AND!) &lt;a href="https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/"&gt;options&lt;/a&gt; in a bash script...it's a whole kerfuffle ! Well, "NO MORE !" I say !&lt;/p&gt;
&lt;h2&gt;
  
  
  Meet parseArger
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dimitrigilbert.github.io/parseArger/"&gt;ParseArger&lt;/a&gt; is a bash program to generate standalone bash programs, at least :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the argument and option parsing (hey, I'm not gonna take your job !),&lt;/li&gt;
&lt;li&gt;and a basic documentation (just the boring part),&lt;/li&gt;
&lt;li&gt;and an install script (...),&lt;/li&gt;
&lt;li&gt;and a bash completion script (...right ?),&lt;/li&gt;
&lt;li&gt;and an html form (whut ..?!)&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;aaaaand&lt;/em&gt; a web server in bash (OH COOOOME ON !)(not really to be used apart from the time you can't do without... I'm just flexing ^^')&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Oh, I know ya'll abunch of impatient nerds (at least I am...) so here is a quick run down to get going !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# download the install script&lt;/span&gt;
curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://raw.githubusercontent.com/DimitriGilbert/parseArger/main/utils/get_parseArger &lt;span class="nt"&gt;-O&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;# make it executable&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x get_parseArger&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;# install, use --help for... help...&lt;/span&gt;
./get_parseArger &lt;span class="nt"&gt;--install&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;# source bashrc, only needed once, modify according to your shell (if you don't know, it's the good one :D)&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.bashrc"&lt;/span&gt;

&lt;span class="c"&gt;# generate a project&lt;/span&gt;
parseArger project my-awesome-project &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--description&lt;/span&gt; &lt;span class="s2"&gt;"this is a cool project !"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="c"&gt;# no commit, push or nothing, for install script generation&lt;/span&gt;
  &lt;span class="nt"&gt;--git-repo&lt;/span&gt; &lt;span class="s2"&gt;"myRandomDevName/my_awesome_project"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--project-subcommand&lt;/span&gt; my-script &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--project-subcommand&lt;/span&gt; another-script

&lt;span class="nb"&gt;cd &lt;/span&gt;my-awesome-project
./my-awesome-project &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;First things first, let's install the damn thing ! &lt;br&gt;
Open up a terminal and execute those commands :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# download the install script&lt;/span&gt;
curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://raw.githubusercontent.com/DimitriGilbert/parseArger/main/utils/get_parseArger &lt;span class="nt"&gt;-O&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;# You are thoughtfully encouraged to spend the next few minutes reading it, just to make sure I do not have nefarious purposes, thank you.&lt;/span&gt;

&lt;span class="c"&gt;# make it executable&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x get_parseArger&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;# install&lt;/span&gt;
./get_parseArger &lt;span class="nt"&gt;--install&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;# source bashrc, only needed once, modify according to your shell (if you don't know, it's the good one :D)&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.bashrc"&lt;/span&gt;

&lt;span class="c"&gt;# check install&lt;/span&gt;
parseArger &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More help is available on the install script, just type &lt;code&gt;./get_parseArger --help&lt;/code&gt; in your terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generate a script
&lt;/h2&gt;

&lt;p&gt;Let's start simple with a script that has one argument, one option and one flag. We'll output the generated content to ./my-script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--help-message&lt;/span&gt; &lt;span class="s2"&gt;"this is a script"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--pos&lt;/span&gt; &lt;span class="s1"&gt;'my-arg "my argument"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'my-option "my option"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--flag&lt;/span&gt; &lt;span class="s1"&gt;'a-flag "boolean flag for my script"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; my-script
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are now free to add your actual code at the bottom of the generated file. It will not be modified if (when !) you update the parsing code using &lt;code&gt;parse&lt;/code&gt;.&lt;br&gt;
There are more options for --pos, --opt and --flag, I'll dive deeper into that in further articles ;).&lt;br&gt;
Concerning variable created, &lt;code&gt;-&lt;/code&gt; will be replaced with &lt;code&gt;_&lt;/code&gt; and the variable will be prefixed with &lt;code&gt;_arg_&lt;/code&gt;.&lt;br&gt;
So --my-super-argument value is assigned to $_arg_my_super_argument&lt;/p&gt;
&lt;h2&gt;
  
  
  Parse a script
&lt;/h2&gt;

&lt;p&gt;Now that we have a script, needs have changed and we miss some options... Let's fix that then !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# -i (or --in-place) means that we update the file with the newly generated parsing code, keeping your custom code&lt;/span&gt;
parseArger parse ./my-script &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'missing-option "my missing option"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--opt&lt;/span&gt; &lt;span class="s1"&gt;'another-opt "yet another one"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done, you you make the code that uses them :).&lt;/p&gt;

&lt;h2&gt;
  
  
  Completion script
&lt;/h2&gt;

&lt;p&gt;The best thing about the terminal ? completion ! &lt;br&gt;
You can't get your mouse on the most likely button you'll need to click in a window (erf, maybe, but ...the usability...).&lt;br&gt;
Well, you can in a terminal :D. Creating the scripts manually though ? Gee..., no !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger completely my-script ./my-script

&lt;span class="nb"&gt;source&lt;/span&gt; ./completely.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember you'll have to source the completion script to access completion in the terminal, you can add &lt;code&gt;source /path/to/my-script/completion.bash&lt;/code&gt; to your .bashrc (or .zshrc and so on)&lt;/p&gt;

&lt;p&gt;You will need &lt;a href="https://github.com/DannyBen/completely"&gt;completely&lt;/a&gt; installed for the generation to work, but once generated it's standalone.&lt;/p&gt;

&lt;p&gt;Sometimes, things here do not work as expected and I can't figure out why, if it does for you to, use this as a workaround&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# do not run completely&lt;/span&gt;
parseArger completely my-script &lt;span class="se"&gt;\&lt;/span&gt;
  ./my-script &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--no-run-completely&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; completely.yaml

&lt;span class="c"&gt;# use the completely preview and pipe to a file...&lt;/span&gt;
completely preview &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; completely.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;We all have that pesky collegue that never remember how to use the oh so fantastic tools that you create (AKA you in 6 months).&lt;br&gt;
Let's think about that guy a bit and throw him a bone with some documentation !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger document ./my-script &lt;span class="nt"&gt;--out&lt;/span&gt; documentation.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's not perfect as it is just the command help in a md file, but it's a whole lot better than nothing, eh ?&lt;/p&gt;

&lt;h2&gt;
  
  
  Project, anyone ?
&lt;/h2&gt;

&lt;p&gt;You might say that is a whole bunch of mess for a puny script, and you'd be very right !&lt;br&gt;
Who says you have to stop with one script though ? I didn't.&lt;br&gt;
You'd have several ways to do that but I settled on a very opinionated project structure that is as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── &amp;lt;program&amp;gt;
├── &amp;lt;program&amp;gt;.rc
├── completely.bash
├── completely.yaml
├── documentation.md
├── form.html
├── Makefile
├── readme.md
├── bin
│   ├── command-one
│   ├── command-two
│   ├── ...
└── utils
    ├── get_&amp;lt;program&amp;gt;
    ├── install
    └── webserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And of course I made a parseArger command for that : &lt;code&gt;project&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger project my-bash-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Off the bat, it'll create the main program, an rc file for your bashrc, documentation, readme and misc stuff (makefile, installer, webserver, html form). It'll initialize a git repo in the created folder but won't add or commit anything.&lt;br&gt;
With some options, it'll also create the &lt;code&gt;bin&lt;/code&gt; folder and command scripts, configure the main program to use these commands (as for &lt;code&gt;generate&lt;/code&gt; there'll be another article).&lt;/p&gt;

&lt;h2&gt;
  
  
  What belongs to Ceasar
&lt;/h2&gt;

&lt;p&gt;This project was started because I couldn't find out how to modify &lt;a href="https://github.com/matejak/argbash"&gt;argbash&lt;/a&gt;.&lt;br&gt;
Most of the work was (well) done so I took the generated output and went at building a similar generator.&lt;br&gt;
It is not as fancy as the original work and a bit of "grog brain developer" display ... but, meh, it works &lt;em&gt;and it's miiiine&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;On that subject, if you are interested in a more rounded up bash generator thingy, you might want to have a look at &lt;a href="https://github.com/DannyBen/bashly/"&gt;bashly&lt;/a&gt;, I use completely which is a part of it and it's awesome !&lt;/p&gt;

&lt;h2&gt;
  
  
  What now ?
&lt;/h2&gt;

&lt;p&gt;Well, have at it ! Have fun, create awesome scripts with sh load of options !&lt;br&gt;
Also as I am the only user, it's getting hard to find bugs to squash, though I am pretty sure nests can be found.&lt;br&gt;
And if no bugs are to be found, maybe you have a use case I didn't think of and everyone would benefit from.&lt;br&gt;
All that can be done using issues on &lt;a href="https://github.com/DimitriGilbert/parseArger"&gt;parseArger's github repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for the read and I hope you found it useful (or at least entertaining :D )&lt;/p&gt;

&lt;p&gt;See you around and happy coding !&lt;/p&gt;

</description>
      <category>bash</category>
      <category>cli</category>
      <category>linux</category>
      <category>terminal</category>
    </item>
    <item>
      <title>ParseArger deeper : generate and parse scripts</title>
      <dc:creator>Dimitri Gilbert</dc:creator>
      <pubDate>Sat, 07 Oct 2023 13:25:49 +0000</pubDate>
      <link>https://dev.to/dimitrigilbert/parsearger-deeper-generate-and-parse-49n6</link>
      <guid>https://dev.to/dimitrigilbert/parsearger-deeper-generate-and-parse-49n6</guid>
      <description>&lt;p&gt;We previously had a quick look at &lt;a href="https://dimitrigilbert.github.io/parseArger/"&gt;parseArger&lt;/a&gt;.&lt;br&gt;
Let's focus on the generate and parse command today !&lt;br&gt;
I tried to make my arguments descriptions fairly clear, but an example is always nice don't you think ?&lt;/p&gt;
&lt;h2&gt;
  
  
  Generate
&lt;/h2&gt;

&lt;p&gt;This command will generate (yeah I know, much creativity) a new bash script.&lt;br&gt;
We'll have a look at them one by one but here are the whole lot of arguments, options and flags for the command. (yes, this is the output from --help ^^)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;-p&lt;/span&gt;, &lt;span class="nt"&gt;--pos&lt;/span&gt; &amp;lt;pos&amp;gt;: positional argument declaration, repeatable
&lt;span class="nt"&gt;-o&lt;/span&gt;, &lt;span class="nt"&gt;--opt&lt;/span&gt; &amp;lt;opt&amp;gt;: optional arg declaration, repeatable
&lt;span class="nt"&gt;-f&lt;/span&gt;, &lt;span class="nt"&gt;--flag&lt;/span&gt; &amp;lt;flag&amp;gt;: flag declaration, repeatable
&lt;span class="nt"&gt;-s&lt;/span&gt;, &lt;span class="nt"&gt;--set&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: &lt;span class="nb"&gt;declare &lt;/span&gt;var, repeatable
&lt;span class="nt"&gt;-l&lt;/span&gt;, &lt;span class="nt"&gt;--source&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: file to &lt;span class="nb"&gt;source&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;-m&lt;/span&gt;, &lt;span class="nt"&gt;--help-message&lt;/span&gt; &amp;lt;help-message&amp;gt;: &lt;span class="nb"&gt;help &lt;/span&gt;message &lt;span class="k"&gt;for &lt;/span&gt;the &lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' I send an SOS to the world '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--help-option&lt;/span&gt; &amp;lt;help-option&amp;gt;: &lt;span class="nb"&gt;help &lt;/span&gt;option trigger
&lt;span class="nt"&gt;--help-short-option&lt;/span&gt; &amp;lt;help-short-option&amp;gt;: short &lt;span class="nb"&gt;help &lt;/span&gt;option
&lt;span class="nt"&gt;--leftovers-name&lt;/span&gt; &amp;lt;leftovers-name&amp;gt;: extra arguments variable name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' leftovers '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--use-shebang&lt;/span&gt; &amp;lt;use-shebang&amp;gt;: shebang executable &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' /bin/bash '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--set-version&lt;/span&gt; &amp;lt;set-version&amp;gt;: &lt;span class="nb"&gt;set &lt;/span&gt;version number
&lt;span class="nt"&gt;--version-opt-name&lt;/span&gt; &amp;lt;version-opt-name&amp;gt;: version option name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' version '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--version-short-option&lt;/span&gt; &amp;lt;version-short-option&amp;gt;: version short option name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' v '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--die-fn-name&lt;/span&gt; &amp;lt;die-fn-name&amp;gt;: die &lt;span class="k"&gt;function &lt;/span&gt;name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' die '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--log-fn-name&lt;/span&gt; &amp;lt;log-fn-name&amp;gt;: log &lt;span class="k"&gt;function &lt;/span&gt;name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' log '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--verbose-opt-name&lt;/span&gt; &amp;lt;verbose-opt-name&amp;gt;: verbose option name &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' verbose '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--verbose-level&lt;/span&gt; &amp;lt;verbose-level&amp;gt;: default verbose level &lt;span class="o"&gt;[&lt;/span&gt;default: &lt;span class="s1"&gt;' 0 '&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="nt"&gt;--leftovers&lt;/span&gt;|--no-leftovers: accept extra arguments
&lt;span class="nt"&gt;--bang&lt;/span&gt;|--no-bang: include shebang, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-bang&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;--version-opt&lt;/span&gt;|--no-version-opt: generate version opt handling, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-version-opt&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;--use-verbose&lt;/span&gt;|--no-use-verbose: generate verbose level parser, on by default &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="nt"&gt;--no-use-verbose&lt;/span&gt; to turn it off&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;--parse-leftovers&lt;/span&gt;|--no-parse-leftovers: parse leftovers, force leftover
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Forget about --pos --opt and --flag, we are going over them in a different article.&lt;/p&gt;

&lt;h3&gt;
  
  
  --set
&lt;/h3&gt;

&lt;p&gt;repeatable, declare a variable at the top of the script.&lt;br&gt;
It can use &lt;code&gt;$()&lt;/code&gt; to run commands but be careful about escaping (which might cause trouble with parsing sometimes...)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="s1"&gt;'my_var="my value"'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="s1"&gt;'my_var_dynamic_var="\$(cat /a/file)"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --source
&lt;/h3&gt;

&lt;p&gt;repeatable, source a file at the top of the script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--source&lt;/span&gt; &lt;span class="s2"&gt;"/path/to/the/file"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --help-message
&lt;/h3&gt;

&lt;p&gt;the script help message. It might be a good idea to make it useful, but you don't have to... 3:-D&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--help-message&lt;/span&gt; &lt;span class="s1"&gt;'my script does something'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --help-option
&lt;/h3&gt;

&lt;p&gt;option used to trigger help, the fact that you can does not mean that you should.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--help-option&lt;/span&gt; &lt;span class="s1"&gt;'not-very-helpful-help-opt'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --help-short-option
&lt;/h3&gt;

&lt;p&gt;short option help trigger&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--help-short-option&lt;/span&gt; z
&lt;span class="c"&gt;# because why not z ?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --leftovers-name
&lt;/h3&gt;

&lt;p&gt;extra argument array variable name. Forces --leftovers flag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--leftovers-name&lt;/span&gt; &lt;span class="s2"&gt;"extra_args"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --use-shebang
&lt;/h3&gt;

&lt;p&gt;specify the shebang, the generated script does not change though, use at your own risk ;).&lt;br&gt;
If you have cross shell compatibility tips and tricks, I am all ears !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--use-shebang&lt;/span&gt; &lt;span class="s2"&gt;"#!/bin/zsh"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --set-version
&lt;/h3&gt;

&lt;p&gt;give a version to the script, not enforcing any kind of whatever here, you can &lt;code&gt;--set-version "potato"&lt;/code&gt;, i won't judge&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--set-version&lt;/span&gt; &lt;span class="s2"&gt;"0.1-alpha-preview-48"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --version-opt-name
&lt;/h3&gt;

&lt;p&gt;version trigger option, &lt;code&gt;--version&lt;/code&gt; by default, but if you hate conventions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--version-opt-name&lt;/span&gt; revision
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --version-short-option
&lt;/h3&gt;

&lt;p&gt;short option trigger for version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--version-short-option&lt;/span&gt; i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --die-fn-name
&lt;/h3&gt;

&lt;p&gt;who wouldn't choose how one dies ? Bar that, I'll let you choose how your script dies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--die-fn-name&lt;/span&gt; wasted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --log-fn-name
&lt;/h3&gt;

&lt;p&gt;same as die, but I have nothing funny to add, so I think I am just rambling at this point, don't you think ?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--log-fn-name&lt;/span&gt; report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --verbose-opt-name
&lt;/h3&gt;

&lt;p&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--verbose-opt-name&lt;/span&gt; tmi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --verbose-level
&lt;/h3&gt;

&lt;p&gt;default verbose level for your script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--verbose-level&lt;/span&gt; 42
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --leftovers | --no-leftovers
&lt;/h3&gt;

&lt;p&gt;do not waste ! Think about those poor scripts which do not have options.&lt;br&gt;
So you pack all these nice extra arguments and options in an array for later ! And do not read from stdin before you finished it all !!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--leftovers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The array variable is &lt;code&gt;$_arg_leftovers&lt;/code&gt; or &lt;code&gt;$_arg_&amp;lt;whatever you chose with --leftovers-name&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  --parse-leftovers | --no-parse-leftovers
&lt;/h3&gt;

&lt;p&gt;Force --leftovers and if you hate unordered mess, you can parse the leftovers and look for option like syntax to be extracted in an associative array. How neat.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--parse-leftovers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The array variable is &lt;code&gt;$_arg_parsed_leftovers&lt;/code&gt; or &lt;code&gt;$_arg_parsed_&amp;lt;whatever you chose with --leftovers-name&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  --bang | --no-bang
&lt;/h3&gt;

&lt;p&gt;use a shebang, on by default&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--no-bang&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --version-opt | --no-version-opt
&lt;/h3&gt;

&lt;p&gt;versions are for looooooosers ! #mainOrDie&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--no-version-opt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  --use-verbose | --no-use-verbose
&lt;/h3&gt;

&lt;p&gt;when you have nothing to say anyway (or way too many, and you won't stop, and you know you should, but you won't...)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parseArger generate &lt;span class="nt"&gt;--no-use-verbose&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Parse
&lt;/h2&gt;

&lt;p&gt;Whether it is because you forgot something, "oooh, i might be able to do that..." or "DO THAT !", requirements change, just generating the script is already nice but a way to update it would be nicer, like if we couuuuld... &lt;em&gt;parse&lt;/em&gt; the script (...).&lt;br&gt;
Like with &lt;code&gt;generate&lt;/code&gt; command, the whole bunch of options and then details, if you don't find the documentation below, it's because it's the same as &lt;code&gt;generate&lt;/code&gt;, so look up !&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;file: file to parse
&lt;span class="nt"&gt;-p&lt;/span&gt;, &lt;span class="nt"&gt;--pos&lt;/span&gt; &amp;lt;pos&amp;gt;: add positional argument declaration, repeatable
&lt;span class="nt"&gt;-o&lt;/span&gt;, &lt;span class="nt"&gt;--opt&lt;/span&gt; &amp;lt;opt&amp;gt;: add optional arg declaration, repeatable
&lt;span class="nt"&gt;-f&lt;/span&gt;, &lt;span class="nt"&gt;--flag&lt;/span&gt; &amp;lt;flag&amp;gt;: add flag declaration, repeatable
&lt;span class="nt"&gt;-s&lt;/span&gt;, &lt;span class="nt"&gt;--set&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: add &lt;span class="nb"&gt;declare &lt;/span&gt;var, repeatable
&lt;span class="nt"&gt;-l&lt;/span&gt;, &lt;span class="nt"&gt;--source&lt;/span&gt; &amp;lt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;: add file to &lt;span class="nb"&gt;source&lt;/span&gt;, repeatable
&lt;span class="nt"&gt;--set-version&lt;/span&gt; &amp;lt;set-version&amp;gt;: &lt;span class="nb"&gt;set &lt;/span&gt;version
&lt;span class="nt"&gt;-i&lt;/span&gt;|--inplace|--no-inplace: replace parseArger generated content &lt;span class="k"&gt;in &lt;/span&gt;place
&lt;span class="nt"&gt;--leftovers&lt;/span&gt;|--no-leftovers: add leftovers
&lt;span class="nt"&gt;--parse-leftovers&lt;/span&gt;|--no-parse-leftovers: parse leftovers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  file
&lt;/h3&gt;

&lt;p&gt;path to the file to parse, yes it is a positional argument, thank you for noticing the absence of &lt;code&gt;-&lt;/code&gt;.&lt;br&gt;
You are such an attentive reader :)&lt;/p&gt;

&lt;h3&gt;
  
  
  --inplace
&lt;/h3&gt;

&lt;p&gt;update the file directly, goes to stdout by default&lt;/p&gt;

&lt;h2&gt;
  
  
  What now ?
&lt;/h2&gt;

&lt;p&gt;Another article is coming to dive deeper in --pos, --opt and --flag options for both generate and parse so you can truly take full advantage of parseArger ;) ! &lt;br&gt;
But this has been most of my usage, barebones arguments, simple options (and a few flags, not often).&lt;br&gt;
This is such a step up from bash scripts I created in the past, especially with the generated help !&lt;br&gt;
What about you ? Would this help you or are you using other languages when "more complex" scripts are needed ?&lt;/p&gt;

&lt;p&gt;See you around and happy coding !&lt;/p&gt;

</description>
      <category>bash</category>
      <category>cli</category>
      <category>linux</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
