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

Implement choice type #121

Merged
merged 11 commits into from
Dec 6, 2016
Merged

Implement choice type #121

merged 11 commits into from
Dec 6, 2016

Conversation

iliclaey
Copy link
Contributor

@iliclaey iliclaey commented Jul 13, 2016

Fixes #114

The choice type determines if a string is in a list of possible choices (name from to the python optparse choice option). This would replace the current heavy usage of string with match(SELF, '^(a|b|c)$') with

    "attr" ? choice('a', 'b', 'c')

String as a basetype is the most common one (or even only one). makes no sense for boolean i think, and long already has long(1..4) which is something similar. so only float is not covered, which i think is acceptable.

The choice-type
~~~~~~~~~~~~~~~
The choice type is an advanced type that can be used to create user-defined types.
It takes two or more strings as input arguments. These arguments represent the
Copy link
Member

Choose a reason for hiding this comment

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

it's true that choice with one argument makes not much sense, but it should be possible (i assume it is). re rephrase this to one or more

@jrha
Copy link
Member

jrha commented Jul 14, 2016

This title of this PR should be imperative, i.e. "Implement choice type", copying some of the description from the linked issue would also be helpful to people reading change logs later on.

@jrha jrha added this to the 10.4 milestone Nov 24, 2016
@jrha jrha changed the title Added choice type Implement choice type Nov 24, 2016
@jrha jrha merged commit d991bf6 into quattor:master Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants