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

OptionParser requires passing the :switches or :strict option #43

Open
jfpedroza opened this issue Nov 7, 2018 · 1 comment
Open

OptionParser requires passing the :switches or :strict option #43

jfpedroza opened this issue Nov 7, 2018 · 1 comment
Assignees
Labels

Comments

@jfpedroza
Copy link
Contributor

OptionParser now requires passing the :switches or :strict option, otherwise it throws a warning everytime it's used. I would like to ask: What is the purpose of using OptionParser to parse the input from ask and the other functions from Loki.Shell?

This is what I get when I run the tests (in 6 of them):

...warning: not passing the :switches or :strict option to OptionParser is deprecated
  (elixir) lib/option_parser.ex:562: OptionParser.build_config/1
  (elixir) lib/option_parser.ex:197: OptionParser.parse/2
  test/loki/shell_test.exs:11: anonymous fn/0 in Loki.ShellTest."test Shell #ask input"/1
  (ex_unit) lib/ex_unit/capture_io.ex:150: ExUnit.CaptureIO.do_capture_io/2
  (ex_unit) lib/ex_unit/capture_io.ex:120: ExUnit.CaptureIO.do_capture_io/3
  test/loki/shell_test.exs:10: Loki.ShellTest."test Shell #ask input"/1
  (ex_unit) lib/ex_unit/runner.ex:312: ExUnit.Runner.exec_test/1
  (stdlib) timer.erl:166: :timer.tc/1
  (ex_unit) lib/ex_unit/runner.ex:251: anonymous fn/4 in ExUnit.Runner.spawn_test/3

@khusnetdinov
Copy link
Owner

@johnf9896, Loki was developed as a tool that helps develop terminal friendly apps. So we have yes, no, aks methods. So ask method something like helper that you allow compound you methods for "asking custom questions". I think there are 2 ways for solve you problem:

  1. Remove
  2. Set default value with the possibility to pass you settings for options parser.

Could you write a code example or your case for this method?

@khusnetdinov khusnetdinov self-assigned this Nov 7, 2018
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