Closed blowfishpro closed 1 year ago
I think we want to wrap the whole CLI to make it future-proof, aka your second option. Want to PR?
I think that would involve wrapping everything in bin/commands
in module(s) - it would be a lot of changes but relatively straightforward. I can do that if that sounds reasonable.
@blowfishpro Sounds reasonable I think! Thanks.
Steps to Reproduce
bin/slack
command in some way that would produce an errorslack --vcr-cassette-name=web/auth_test_error --slack-api-token=token auth test
from the test suite will doObserved behavior You get an error message:
error: wrong number of arguments (given 1, expected 0)
Desired behavior You get the actual error message, e.g.
error: not_authed
Explanation
slack
script includesGLI::App
at the top levelGLI::App
in theObject
class:Faraday::Middleware
callson_error
on itself with an exception it that method is implementedGLI::App#on_error
which has a completely different meaningPossible Fixes
include GLI::App
withextend GLI::App
... all the tests seem to pass with this change (in this case it's included in the singleton class of the main object rather thanObject
)extend GLI::App
(this seems to be what GLI's docs mostly reference)