zigalenarcic / mangl

An enhanced man page viewer for linux and BSD systems based on OpenGL and mandoc libraries
Other
39 stars 7 forks source link

Use getopt_long to parse the options #4

Closed omar-polo closed 2 years ago

omar-polo commented 2 years ago

This PR switches the main to use getopt_long for parsing the flags given on the command line. Using getopt(3) or getopt_long(3) should be preferred over manually parsing, as they already cover a lot of edge cases.

While here I also couldn't resist the temptation to add a single letter version for the long flags and mention the flags in the manpage too.

zigalenarcic commented 2 years ago

Thank you very much. I didn't use getopt() since I was not familiar with it, no other reason.