Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate using gengetopt for command line options #3

Closed
dharple opened this issue Mar 4, 2017 · 1 comment
Closed

Investigate using gengetopt for command line options #3

dharple opened this issue Mar 4, 2017 · 1 comment

Comments

@dharple
Copy link
Owner

dharple commented Mar 4, 2017

gengetopt allows for abstraction of the command line options. Review whether it's a good fit.

@dharple dharple self-assigned this Mar 4, 2017
@dharple dharple added the wontfix label Mar 4, 2017
@dharple
Copy link
Owner Author

dharple commented Mar 4, 2017

It's interesting. Here's how it would work:

We would create two .ggo files, one for inline detox and one for detox:

package "detox"
version "1.3.0"

option "config"          f  "choose which config file to use" string typestr="filename"
option "dry-run"         n  "do a dry run (don't actually do anything)"
option "inline"          -  "run inline mode"
option "list"            L  "list available sequences and exit\nwith -v ... dump sequence contents"
option "recursive"       r  "be recursive (descend into subdirectories)"
option "remove-trailing" -  "remove trailing _ and - before or after a period"
option "sequence"        s  "choose which sequence to detox with"

Then, to build them, the line would look something like this:

gengetopt < parse_options_detox.ggo --file=parse_options_detox --func-name=parse_options_detox --arg-struct-name=detox_options --unamed-opts

Unfortunately, because ggo generates its own structure (per include file), we can't use the same structure prefix. Also, because you can't fully rename the functions inside of the generated .c file, we might also need to create two similar parse_options.c files, to dump the output from this in to the existing (neutral) structure.

I'm not sure all of that is worth the effort.

@dharple dharple closed this as completed Mar 4, 2017
@dharple dharple assigned dharple and unassigned dharple Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant