You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per longstanding PR #83, I have some ideas on ways to enhance behavior of optimist in ways that may not be backward compatible (see below). In order to make these new behaviors opt-in, it would be nice to have a way to tell optimist how to enable them.
Alternative-1 causes order dependence (of the setting enablement and the opt command) which feels like it's not in the spirit of most DSLs.
Alternative-2 causes problems with the cloaker function that is in Optimist.new
Alternative-3 is ugly since it applies globally.
Would like maintainer/interested parties from previous PR's opinions ( @kbrock@Fryguy@jrafanie@chrisarcand ) on the best implementation before trying to resurrect #83.
For reference, suggested behavior enhancements would include the following and will probably be in separate PRs going forward:
:enable_inexact_match : Allow minimum unambigous number of characters to match a long option (similar to Perl Getopt::Long)
:disable_auto_short_opts : Prevent automatic creation of short options
:enable_suggestions : Enables suggestions when unknown arguments are given and DidYouMean is installed.
The text was updated successfully, but these errors were encountered:
nanobowers
changed the title
Best way to apply "settings" for changing optimist behavior
Settings for changing optimist behavior
Jul 4, 2019
Went with option 2 above, PR is #108 which adds inexact_match and suggestions feature. Would be reasonably straightforward to do option 1 above.
This question and associated requests for features has been sitting around over two years now in some form (#83 , etc) if feature additions are not of interest to the maintainers (@kbrock , @Fryguy ), please let me know.
Per longstanding PR #83, I have some ideas on ways to enhance behavior of optimist in ways that may not be backward compatible (see below). In order to make these new behaviors opt-in, it would be nice to have a way to tell optimist how to enable them.
Some implementation ideas include:
Optimist::options
block, e.g.:Optimist.options
Downsides are:
opt
command) which feels like it's not in the spirit of most DSLs.cloaker
function that is inOptimist.new
Would like maintainer/interested parties from previous PR's opinions ( @kbrock @Fryguy @jrafanie @chrisarcand ) on the best implementation before trying to resurrect #83.
For reference, suggested behavior enhancements would include the following and will probably be in separate PRs going forward:
The text was updated successfully, but these errors were encountered: