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

Array slicing. Specify lower and upper indexes to slice an array. #66

Closed
ABridoux opened this issue Jul 3, 2020 · 0 comments · Fixed by #104
Closed

Array slicing. Specify lower and upper indexes to slice an array. #66

ABridoux opened this issue Jul 3, 2020 · 0 comments · Fixed by #104
Labels
enhancement New feature or request
Milestone

Comments

@ABridoux
Copy link
Owner

ABridoux commented Jul 3, 2020

Let the user specify a lower and upper bounds of the elements to display.
Possible syntax: array[lower:upper], array[lower:] to target all indexes from min and array[:upper] to target all index up to max, and array[:] to target all the elements in the array. The CRUD subcommand could then be applied. The read subcommand should output a list.

Examples

Given the following JSON

{
  "names": [
    "Thomas",
    "Jim",
    "Enzo",
    "Duke"
  ],
  "devices": [
    {
      "Id": "ABC",
      "Registered": true
    },
    {
      "Id": "123",
      "Registered": false
    },
    {
      "Id": "456",
      "Registered": false
    }
  ]
}

scout names[1:2] should output Jim\nEnzo
scout delete names[1:]should delete the names Jim, Enzo and Duke

@ABridoux ABridoux added the enhancement New feature or request label Jul 3, 2020
@ABridoux ABridoux added this to the 1.3.0 milestone Jul 3, 2020
@ABridoux ABridoux self-assigned this Jul 3, 2020
@ABridoux ABridoux changed the title CLT: specify min and max elements indexes to display in an array [CLT] Specify min and max elements indexes to display in an array Jul 14, 2020
@ABridoux ABridoux modified the milestones: 1.3.0, 2.0.0 Jul 18, 2020
@ABridoux ABridoux removed their assignment Jul 26, 2020
@ABridoux ABridoux changed the title [CLT] Specify min and max elements indexes to display in an array [CLT] Array slicing. Specify lower and upper indexes to slice an array. Aug 13, 2020
@ABridoux ABridoux changed the title [CLT] Array slicing. Specify lower and upper indexes to slice an array. Array slicing. Specify lower and upper indexes to slice an array. Aug 15, 2020
ABridoux added a commit that referenced this issue Aug 15, 2020
@ABridoux ABridoux mentioned this issue Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant