Skip to content
Myr

core.py: Make error messages more verbose (#2453)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by jaseg · committed by GitHub · parent 8c842a4 · Browse files · 1 file+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Andreas Backx <AndreasBackx@users.noreply.github.com>

Diff stats

1 file+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:src/click/core.py+4 added-2 removed
2669 unmodified lines
26702671 if name is None:2672 if not expose_value:2673 return None, opts, secondary_opts2674 raise TypeError("Could not determine name for option")2674 raise TypeError(2675 f"Could not determine name for option with declarations {decls!r}"2676 )26772678 if not opts and not secondary_opts:2679 raise TypeError(2680 f"No options defined but a name was passed ({name})."
331 unmodified lines
3012 ) -> t.Tuple[t.Optional[str], t.List[str], t.List[str]]:3013 if not decls:3014 if not expose_value:3015 return None, [], []3014 raise TypeError("Could not determine name for argument")3016 raise TypeError("Argument is marked as exposed, but does not have a name.")3017 if len(decls) == 1:3018 name = arg = decls[0]3019 name = name.replace("-", "_").lower()3020 else:
14 unmodified lines