Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a custom Context with align_{} params and a BaseCommand that uses it #16

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

janluke
Copy link
Owner

@janluke janluke commented Apr 21, 2021

  • Added a custom Context class, having the following additional parameters:

    • align_option_groups = True,
    • align_sections = True.

    The corresponding arguments in OptionGroupMixin and SectionMixin were
    set to None. By setting them, you can override the context value.

  • Changed the class hierarchy:

    • added a BaseCommand, extending click.Command and using the custom
      Context by default. This class also "backports" the Click 8.0 class
      attribute context_class.

    • cloup.Command and cloup.MultiCommand extends cloup.BaseCommand

    • cloup.Group now extends cloup.MultiCommand.

- Added a custom `Context` class, having the following additional parameters:

  * ``align_option_groups = True``,
  * ``align_sections = True``.

  The corresponding arguments in ``OptionGroupMixin`` and ``SectionMixin`` were
  set to ``None``. By setting them, you can override the context value.

- Changed the class hierarchy:

  * added a ``BaseCommand``, extending ``click.Command`` and using the custom
    ``Context`` by default. This class also "backports" the Click 8.0 class
    attribute ``context_class``.

  * ``cloup.Command`` and `cloup.MultiCommand` extends ``cloup.BaseCommand``

  * ``cloup.Group`` now extends ``cloup.MultiCommand``.
@janluke janluke merged commit 2fad1f7 into master Apr 21, 2021
@janluke janluke deleted the context branch April 21, 2021 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a custom Context and add align_option_groups and align_sections attrs
1 participant