Skip to content

Refactor commands to share a common class #659

Open
@di

Description

@di

The work done to implement #381 and #511 has indicated that the lack of a common (internal) API for each of our sub-commands has made it challenging to implement flags like --verbose and --no-color across all commands.

#381 (comment) outlines a rough proposal for a TwineCommand which would allow sharing common patterns between commands:

  • twine-wide flags can be implemented in a single place
  • helpers for producing output
  • settings can live on the class instance and not be passed through multiple layers of function calls

This would help ensure that all commands behave in a cohesive manner. It also could lead to a more "short and sweet" implementation for #194.

Implementing this should not result in any changes to Twine's command-line API or behavior. It likely would change our unofficial, internal API that is used by some external projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementquestionDiscussion/decision needed from maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions