Allow self.exit_codes
to be callable with keyword and custom message
#2644
Labels
Milestone
self.exit_codes
to be callable with keyword and custom message
#2644
The use case was presented where one would like to define a generic exit code for a missing file, where one would always want to use the same exit status, but have a customized exit message that includes for example the exact filename. Currently this is not possible, but maybe it would be possible to extend the syntax to be able to do both:
we would have to make the
exit_codes
property callable and override the behavior to construct a newExitCode
instance with the custom message.Or maybe even better, we make the
ExitCode
callable which allows to change the message. This would require theExitCode
to be changed from a named tuple into a class, e.g.:The text was updated successfully, but these errors were encountered: