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

Support a terminal view and traversal path discovery #227

Open
electriquo opened this issue Jun 22, 2022 · 2 comments
Open

Support a terminal view and traversal path discovery #227

electriquo opened this issue Jun 22, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@electriquo
Copy link

Is your feature request related to a problem? Please describe.
When working with a big and non flat data stored in JSON/YAML/XML, it is not always comfortable to examine the data when it is expended automatically and/or find the JSON/YAML/XML traversal path (select query) to select the data

Describe the solution you'd like
It would be nice if dasel would support a terminal view (folding/expanding of nested object, coloring, etc) while assisting in displaying\discovering the traversal path which is examined, in the same spirit as fx does (see path discovery at the bottom)

fx

Describe alternatives you've considered
There are other tools which has a support for these features. E.g. fx, though it is inconvenient to use other tools since:

  1. Each tool needs to be installed separately
  2. Each tool has its own traversal path syntax per a data structure

Yet, there is no single tool like dasel, which supports the same traversal path (select query) for all supported data structures (file types)

Additional context
I assume that dasel uses the same data structure when parsing each type (JSON/YAML/XML/etc.), thus displaying this data structure on the terminal and be able to traverse it while discovering the traversal path might be a killer feature

@electriquo electriquo added the enhancement New feature or request label Jun 22, 2022
@TomWright
Copy link
Owner

Dasel does use the same data structure, although we'd need to settle on a single display format which may be a little strange if viewing XML data and it displays in a JSON-like format.

That said, I do think this is a cool feature and worth adding in the future.
I've not done anything like this before so am open to suggestions/PR's

@electriquo
Copy link
Author

we'd need to settle on a single display format

regardless of how it will be displayed (all could be natively treated as a trees), the display could be traversed and show the traversed path.

@TomWright maybe it is feasible to "port" fx display, which is written in golang.

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

No branches or pull requests

2 participants