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

Figure out a way to sanely maintain a list of options #188

Closed
hoelzro opened this issue Dec 18, 2012 · 5 comments
Closed

Figure out a way to sanely maintain a list of options #188

hoelzro opened this issue Dec 18, 2012 · 5 comments
Labels

Comments

@hoelzro
Copy link
Collaborator

hoelzro commented Dec 18, 2012

We need to keep options in sync in so many places; where things need to change is documented, but I feel like adding a new option has become a gigantic PITA. Figure it out!

Here are the troubles associated with an option as they currently stand:

  • There's not a single place to look for options. Most options are found in App::Ack::ConfigLoader::get_arg_spec; however, there are some that are not but are still in App::Ack::ConfigLoader (ex. --type-add and friends), and some that are not even in
    that file (ex. --bar, --thppt).
  • The way we test for an option in the documentation is suboptimal. We need to check that an option is present in --help, as well as the OPTIONS section of the --man output.
  • We need to maintain a list of which options are mutually exclusive with one another.
  • Once we have a shell completion script, we'll need to put the options in there as well.

This list can probably be improved upon, but this is what I've got at the moment.

@hoelzro
Copy link
Collaborator Author

hoelzro commented Jan 2, 2013

On a sidenote: sometimes I'm tempted to write App::Ack::OptionParser, either as a layer over Getopt::Long or from scratch. The option parsing needs for ack2 have become pretty specific, and it may be getting to be too much for Getopt::Long to handle.

@petdance
Copy link
Collaborator

petdance commented Jan 2, 2013

I can see writing a wrapper around Getopt::Long, but I'm wary of replicating it.

@hoelzro
Copy link
Collaborator Author

hoelzro commented Jan 2, 2013

That's probably what I'd do.

@hoelzro
Copy link
Collaborator Author

hoelzro commented Jan 6, 2013

I've made some progress on this; I haven't come with a solution for the issue itself, but tests that wish to access the list of options that ack supports should call get_options(). This list is something else to maintain and may not always be perfect, but at least it's a point that tests can depend on until we figure this out.

@hoelzro
Copy link
Collaborator Author

hoelzro commented Jan 8, 2013

@petdance I think we may need to have a Skype chat or something about this at some point.

@petdance petdance removed this from the Sooner milestone Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants