avibrazil / RDM

Easily set Mac Retina display to higher unsupported resolutions
4.13k stars 352 forks source link

Use getopt_long() to standardize command line processing #41

Open rread opened 4 years ago

rread commented 4 years ago

I noticed that a missing parameter can cause a segfault because the original code did no sanity checking on argv[]. A better solution is to use a standard cli parsing facility like getopt_long().

One downside is switching to getopt forced changing the nonstandard short commands "-ld" and "-lm" to "-l" and "-m", respectively.