26 ms·
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 incl
by aidenn0 6y ago
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/options.sh https://github.com/jasom/the-copper-searcher/blob/master/opt...