I just started writing my first CLI tool for a PCB trace width calculator. I initially started getting the options using strcmp()
but then moved on the getopt()
as my program got more complicated. I then read about getopt_long()
which is a GNU extension and Argp
(link) which I’m guessing is the same? And then you have Gengetopt
(link) which is used to generate code (I have no idea)? Can there be a discussion of which one is the best in what scenario? I initially thought it’s best to write POSIX compatible code for CLI tools so I wrote everything with getopt()
. Other people’s opinions on this would be interesting!