5 ms·
> * multiple options can be combined: -abc is the same as -a -b -c > * option values can be separated by a space, equal sign, or nothing: -a1 -a=1 -a 1 are all
by arccy 2y ago
> * multiple options can be combined: -abc is the same as -a -b -c
> * option values can be separated by a space, equal sign, or nothing: -a1 -a=1 -a 1 are all equal
> * options can have multiple values: -a 1 2 3 means that a is an array/slice/struct of three numbers of value [1,2,3]
while convenient, one of the reasons I dislike gnu style flags is just how inconsistent they can be and annoyingly hard to parse by humans
- nine_k 2y agoUnderstandable! This is because `-a 1 2 3` assiging a = [1, 2, 3] is not GNU style. If you want that, the GNU style could be `-a "1 2 3"`. Normally `-a 1 2 3` would be a = 1, and 2 and 3 being positional arguments. A clarified way to write the same would be `-a 1 -- 2 3`.
- guappa 2y agoYeah this library is not GNU-style at all as it is.