-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
area/uxFeatures and improvements related to the user experienceFeatures and improvements related to the user experiencekind/enhancementNot a bug or feature, but improves usability or performanceNot a bug or feature, but improves usability or performance
Description
Right now if a cli user accidentally adds a wrong option or provides an incorect value, the error with the stack trace is ... rather intimidating. This should be improved by displaying a more useful message. The change actually might be required in clikit unfortunately.
$ poetry --vers
[NoSuchOptionException]
The "--vers" option does not exist.
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/clikit/console_application.py", line 123, in run
io = io_factory(
File "/home/user/.local/lib/python3.8/site-packages/poetry/console/config/application_config.py", line 168, in create_io
resolved_command = application.resolve_command(args)
File "/home/user/.local/lib/python3.8/site-packages/clikit/console_application.py", line 110, in resolve_command
return self._config.command_resolver.resolve(args, self)
File "/home/user/.local/lib/python3.8/site-packages/clikit/resolver/default_resolver.py", line 43, in resolve
result = self.process_default_commands(args, application.default_commands)
File "/home/user/.local/lib/python3.8/site-packages/clikit/resolver/default_resolver.py", line 104, in process_default_commands
if resolved_command.is_parsable():
File "/home/user/.local/lib/python3.8/site-packages/clikit/resolver/resolve_result.py", line 43, in is_parsable
self._parse()
File "/home/user/.local/lib/python3.8/site-packages/clikit/resolver/resolve_result.py", line 49, in _parse
self._parsed_args = self._command.parse(self._raw_args)
File "/home/user/.local/lib/python3.8/site-packages/clikit/api/command/command.py", line 113, in parse
return self._config.args_parser.parse(args, self._args_format, lenient)
File "/home/user/.local/lib/python3.8/site-packages/clikit/args/default_args_parser.py", line 53, in parse
self._parse(args, _fmt, lenient)
File "/home/user/.local/lib/python3.8/site-packages/clikit/args/default_args_parser.py", line 101, in _parse
self._parse_long_option(token, tokens, fmt, lenient)
File "/home/user/.local/lib/python3.8/site-packages/clikit/args/default_args_parser.py", line 247, in _parse_long_option
self._add_long_option(name, None, tokens, fmt, lenient)
File "/home/user/.local/lib/python3.8/site-packages/clikit/args/default_args_parser.py", line 300, in _add_long_option
raise NoSuchOptionException(name)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/uxFeatures and improvements related to the user experienceFeatures and improvements related to the user experiencekind/enhancementNot a bug or feature, but improves usability or performanceNot a bug or feature, but improves usability or performance