
Show HN: Dead simple option parsing in C - earenndil
http://repo.or.cz/OptFetch.git
======
avdicius
I have something like this here:

[https://github.com/ademakov/MainMemory/blob/master/src/base/...](https://github.com/ademakov/MainMemory/blob/master/src/base/args.h)
[https://github.com/ademakov/MainMemory/blob/master/src/base/...](https://github.com/ademakov/MainMemory/blob/master/src/base/args.c)

It seems your variant does not support the common convention to use lone two
dashes ('\--') to separate options from non-options that for some reason start
with dashes too (e.g. strangely named files).

My version supports typed values at a different level integrated with config
file parsing. So the command line argument values are just strings for me.

~~~
earenndil
> It seems your variant does not support the common convention to use lone two
> dashes ('\--') to separate options from non-options that for some reason
> start with dashes too (e.g. strangely named files).

It does, actually. See
[http://repo.or.cz/OptFetch.git/blob/HEAD:/optfetch.c#l172](http://repo.or.cz/OptFetch.git/blob/HEAD:/optfetch.c#l172)

~~~
avdicius
Oops, sorry. Have no idea why I overlooked it.

