News for hackers. Stuff that matters.
Re:Bash code generator for command-line arguments by aidenn0 on Friday October 02, 2020 @11:03AM (#24663360)
This is incredibly full featured.

I wrote a much less full featured and less ergonomic library that targets sh rather than bash. It was 70 lines of shell including whitespace.

Here's an example of its usage[1]. Each option calls a function, optionally with an argument. There is also sugar for options that merely toggle a value.

Non flag parameters call a function "positional parameter" to avoid a dependence on arrays.

It does not generate usage or man pages.

1: https://github.com/jasom/the-copper-searcher/blob/master/opt...

There are no comments on this comment yet.