A second Julia script, analyze_code_length.jl, allows us to compare the actual number of code lines required to use the command-line parsers, and by this the complexity of employing them (including all the manual parsing steps). Thereby, only the lines for the parsing are counted, not the call to the HTML processor, no comments, and no blank lines (except those lying in the help messages and thus being part of the syntax).
Fig. 2: Bar plot of all command-line parsers' code lengths.
The code length statistics are given in the following table:
Tab. 5: Code lengths of all command-line parsers.
| Parser | Code length (absolute) | Code length (relative) |
|---|---|---|
| getopts | 102 | 6.4 |
| getopt | 131 | 8.2 |
| shFlags | 87 | 5.4 |
| docopts | 94 | 5.9 |
| Shell Argparser | 16 | 1.0 |
As you can see, the parsers' number of code lines ranges from 87 to 131 lines, with the Argparser requiring just 16 lines, one fifth to one eighth of the others. So, owing to the Argparser's sophisticated set of features, only very few manual parsing steps are required, and even them are fast to implement.