Change getopt() to getopt_long() #3

Open
opened 2022-07-30 19:37:01 -05:00 by noah · 0 comments
Owner

Change the getopt() in main.cpp for argument parsing.

Current Behavior

Takes single char arguments. We've currently gone through a-h, lmn, p-u, x, z, and '?'.

Desired Behavior

Expand the possible arguments. Reading the man page of getopt(), it looks like getopt_long() should allow us a bit more flexibility.

Possible Solution

It does not appear that a rework of the current getopt() is needed. getopt_long() works just the same as getopt(), but it can also accept long arguments. We can leave the arguments as-is, then add new long arguments.

Change the getopt() in main.cpp for argument parsing. <!--- Provide a general summary of the issue in the Title above --> ## Current Behavior Takes single char arguments. We've currently gone through a-h, lmn, p-u, x, z, and '?'. <!--- Tell us what happens instead of the expected behavior --> ## Desired Behavior Expand the possible arguments. Reading the man page of getopt(), it looks like getopt_long() should allow us a bit more flexibility. ## Possible Solution <!--- Not obligatory, but suggest a fix/reason for the bug, --> It does not appear that a rework of the current getopt() is needed. getopt_long() works just the same as getopt(), but it can also accept long arguments. We can leave the arguments as-is, then add new long arguments.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: noah/ag_gen#3
No description provided.