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

Open
hoelzro opened this Issue Dec 18, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@hoelzro
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

This comment has been minimized.

Show comment Hide comment
@hoelzro

hoelzro Jan 2, 2013

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment Hide comment
@petdance

petdance Jan 2, 2013

Collaborator

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

Collaborator

petdance commented Jan 2, 2013

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

@hoelzro

This comment has been minimized.

Show comment Hide comment
@hoelzro

hoelzro Jan 2, 2013

Collaborator

That's probably what I'd do.

Collaborator

hoelzro commented Jan 2, 2013

That's probably what I'd do.

@hoelzro

This comment has been minimized.

Show comment Hide comment
@hoelzro

hoelzro Jan 6, 2013

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment Hide comment
@hoelzro

hoelzro Jan 8, 2013

Collaborator

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

Collaborator

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