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

Better support for enum types #84

Merged
merged 2 commits into from
Aug 30, 2019
Merged

Better support for enum types #84

merged 2 commits into from
Aug 30, 2019

Conversation

qw3ry
Copy link
Contributor

@qw3ry qw3ry commented Aug 29, 2019

I added RawArgument.enum() and RawOption.enum() to support enum types.

I added a test class. I updated the docs, as well as the changelog

Advantages over choice("A" to A, "B" to B):

  • no redundancy (what if I add C to the enum?)
  • shorter
  • less error prone (avoids typos)

@qw3ry
Copy link
Contributor Author

qw3ry commented Aug 29, 2019

@ajalt there seems to be a problem with the build:

The command "~/bin/install-jdk.sh --target "/home/travis/oraclejdk8" --workspace "/home/travis/.cache/install-jdk" --feature "8" --license "BCL"" failed and exited with 3 during .

@@ -1,7 +1,7 @@
language: java

jdk:
- oraclejdk8
- openjdk8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a problem, I'll revert this, but it fixed the travis build (see https://travis-ci.community/t/install-of-oracle-jdk-8-failing/3038/3)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

Copy link
Owner

@ajalt ajalt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea, thanks! There are a few tweaks to make, but I can do those after merging.

@@ -1,7 +1,7 @@
language: java

jdk:
- oraclejdk8
- openjdk8
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@ajalt ajalt merged commit 76be384 into ajalt:master Aug 30, 2019
sschuberth added a commit to sschuberth/clikt that referenced this pull request Sep 24, 2019
@sschuberth
Copy link
Contributor

I'm looking forward to this! Any ETA for a regular release which includes the enum support?

ajalt pushed a commit that referenced this pull request Sep 24, 2019
@ajalt
Copy link
Owner

ajalt commented Sep 24, 2019

@sschuberth I had been waiting for feedback on #80, but I can make a smaller release without that PR this week.

@sschuberth
Copy link
Contributor

That'd be great @ajalt, thanks!

@ajalt
Copy link
Owner

ajalt commented Sep 29, 2019

@sschuberth version 2.2.0 has been released

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.

3 participants