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 "enum" type for config options #1973

Closed
flashcode opened this issue Jul 3, 2023 · 0 comments
Closed

Add "enum" type for config options #1973

flashcode opened this issue Jul 3, 2023 · 0 comments
Assignees
Labels
feature New feature request
Milestone

Comments

@flashcode
Copy link
Member

Feature description

Today options can be with type "integer" and have "string values": that means they are stored as integer internally but set and shown as strings.

This is confusing and not even consistent, for example /help irc.look.nick_mode shows:

Option "irc.look.nick_mode":
  description: display nick mode (op, voice, ...) before nick (none = never, prefix = in prefix only (default), action = in action messages only, both = prefix + action messages)
  type: string
  values: "none", "prefix", "action", "both"
  default value: "prefix"
  current value: "prefix"

While fset shows the option as integer:

irc.look.nick_mode         integer  prefix

Behavior of type "enum":

  • Works like the "integer": stored as integer, set and shown with a fixed list of strings.
  • For compatiblity, any new option with type "integer" and string values will be automatically created as type "enum".
  • If a new option is created with type "enum" and no string values, this is considered an error and the option is not created.
  • /help and fset plugin show type "enum".

Once implemented, the display of /help irc.look.nick_mode will be:

Option "irc.look.nick_mode":
  description: display nick mode (op, voice, ...) before nick (none = never, prefix = in prefix only (default), action = in action messages only, both = prefix + action messages)
  type: enum
  values: "none", "prefix", "action", "both"
  default value: "prefix"
  current value: "prefix"

Fset plugin will show:

irc.look.nick_mode         enum  prefix
@flashcode flashcode added feature New feature request in progress Someone is working on this issue labels Jul 3, 2023
@flashcode flashcode added this to the 4.1.0 milestone Jul 3, 2023
@flashcode flashcode self-assigned this Jul 3, 2023
@flashcode flashcode removed the in progress Someone is working on this issue label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

1 participant