Skip to content

Fixes commands' syntices#10534

Merged
oranagra merged 4 commits intoredis:unstablefrom
itamarhaber:syntices-1
Apr 6, 2022
Merged

Fixes commands' syntices#10534
oranagra merged 4 commits intoredis:unstablefrom
itamarhaber:syntices-1

Conversation

@itamarhaber
Copy link
Copy Markdown
Member

@itamarhaber itamarhaber commented Apr 5, 2022

Fixes in command argument in json files

  • Fixes BITFIELD's syntax ("sub-commands" can be repeated, and OVERFLOW is only valid for SET and INCR)
  • Improves readability of SET (reordered)
  • Fixes GEOSEARCH and GEOSEARCH_RO syntices (use oneof for mutually exclusive group instead of optional)
  • Fixes MIGRATE syntax (use oneof for mutually exclusive group instead of optional)
  • Fixes MODULE LOADEX syntax (the CONFIG token should be repeated too when using multiple configs)

other:

  • make generate-command-help.rb accept a path to commands.json, or read it from stdin (e.g. generate-commands-json.py | generate-command-help.rb -)

Fixes BITFIELD's syntax
Improves readability of SET
Fixes GEOSEARCH and GEOSEARCH_RO syntices
Fixes MIGRATE syntax
Fixes MODULE LOADEX syntax
@itamarhaber itamarhaber requested review from guybe7 and oranagra April 5, 2022 15:57
Comment thread src/commands/bitfield.json Outdated
Comment thread src/commands/bitfield.json Outdated
Comment thread src/commands/geosearch.json Outdated
Comment thread src/help.h Outdated
Comment thread src/help.h
"2.6.0" },
{ "BITFIELD",
"key [GET encoding offset] [SET encoding offset value] [INCRBY encoding offset increment] [OVERFLOW WRAP|SAT|FAIL]",
"key GET encoding offset|[OVERFLOW WRAP|SAT|FAIL] SET encoding offset value|INCRBY encoding offset increment [GET encoding offset|[OVERFLOW WRAP|SAT|FAIL] SET encoding offset value|INCRBY encoding offset increment ...]",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks like some parenthesis are needed, but that's out of the scope of this PR.
i suppose any element in a oneof or block with more than one element in it, should add (), but then we'll need redis-cli to handle that.
@jhelbaum FYI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we decide to modify the syntax in general, we need to sync that with redis.io too.

@oranagra oranagra merged commit 3e09a8c into redis:unstable Apr 6, 2022
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
Fixes in command argument in json files
* Fixes BITFIELD's syntax ("sub-commands" can be repeated, and OVERFLOW is only valid for SET and INCR)
* Improves readability of SET (reordered)
* Fixes GEOSEARCH and GEOSEARCH_RO syntices (use `oneof` for mutually exclusive group instead of `optional`)
* Fixes MIGRATE syntax (use `oneof` for mutually exclusive group instead of `optional`)
* Fixes MODULE LOADEX syntax (the `CONFIG` token should be repeated too when using multiple configs)

other:
* make generate-command-help.rb accept a path to commands.json, or read it from stdin (e.g. `generate-commands-json.py | generate-command-help.rb -`)
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