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

Support typer arguments #134

Merged
merged 2 commits into from
Apr 5, 2024
Merged

Conversation

aeisenbarth
Copy link
Contributor

@aeisenbarth aeisenbarth commented Apr 3, 2024

Summary

This is a proposal for consistency of the help attribute in options and arguments. Options can have help text, but arguments (currently) not. While click does not provide the help attribute for arguments, it allows subclasses to add it (and provide the custom subclass to @click.argument(…, cls=…)).

With a tiny change this greatly improves support for the popular typer package.

If the help attribute is detected on an argument, it is interpreted just like for options. Otherwise the behavior is as before.

Tasks

  • Added unit tests
  • Added documentation for new features (where applicable)
  • Added release notes (using reno)
  • Ran test suite and style checks and built documentation (tox)

Further details

Solves #132

aeisenbarth and others added 2 commits April 5, 2024 10:11
@stephenfin stephenfin merged commit ff8be91 into click-contrib:master Apr 5, 2024
7 checks passed
@stephenfin
Copy link
Member

Thanks 🙏

hoodmane added a commit to hoodmane/sphinx-click that referenced this pull request May 9, 2024
This is a fix for a regression introduced in click-contrib#134. It's possible that the
argument has a `help` attribute, but the value of it is `None`. We then hit a
type error where we pass `None` to `re.sub`.
hoodmane added a commit to hoodmane/sphinx-click that referenced this pull request May 9, 2024
This is a fix for a regression introduced in click-contrib#134. It's possible that the
argument has a `help` attribute, but the value of it is `None`. We then hit a
type error where we pass `None` to `re.sub`.
stephenfin pushed a commit that referenced this pull request May 14, 2024
This is a fix for a regression introduced in #134. It's possible that the
argument has a `help` attribute, but the value of it is `None`. We then hit a
type error where we pass `None` to `re.sub`.
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.

None yet

2 participants