Skip to content

Add a @finalize decorator for functions to collect/operate on subroutine results. #140

Open
@bckohan

Description

For symmetry with @initialize

This behavior is mostly currently achievable with result_callback that you can pass to Typer.callback or Typer.group. There are two deficiencies:

  1. The command must be compound. There's no way to finalize a singular command. This makes sense, but it'd be nice if the interface uniformly worked.
  2. result_callback is not class aware, so you have to jump through extra hoops to get access to self - namely you need to return it from your subcommands.

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions