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

kdb get -v should also display default values. #2474

Open
Piankero opened this Issue Mar 10, 2019 · 3 comments

Comments

3 participants
@Piankero
Copy link
Contributor

Piankero commented Mar 10, 2019

It is beneficial for users to see where a value from kdb get actually comes from. This is especially useful when default values are taken.

Unforuntately kdb get -v does not indicate anything like that:

kdb get -v '/sw/lcdproc/lcdd/#0/current/curses/foreground'
#> got 660 keys
#> searching spec/sw/lcdproc/lcdd/#0/current/curses/foreground, found: 
#> spec/sw/lcdproc/lcdd/#0/current/curses/foreground, options: KDB_O_CALLBACK
#> The resulting keyname is /sw/lcdproc/lcdd/#0/current/curses/foreground
#> The resulting value size is 5
#> blue

Proposal:

kdb get -v '/sw/lcdproc/lcdd/#0/current/curses/foreground'
#> got 660 keys
#> searching spec/sw/lcdproc/lcdd/#0/current/curses/foreground, found: 
#> spec/sw/lcdproc/lcdd/#0/current/curses/foreground, options: KDB_O_CALLBACK
#> The key was not found in any other namespace, taking the default from the metadata
#> The resulting keyname is /sw/lcdproc/lcdd/#0/current/curses/foreground
#> The resulting value size is 5
#> blue

@Piankero Piankero added the usability label Mar 10, 2019

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

Thank you for reporting this problem and for propose a solution.

A make a minor adaption in the output (swap sentence).

This should be a quite easy fix, a check if the resulting key starts with / is enough to know if a default is used.

@e01306821

This comment has been minimized.

Copy link
Contributor

e01306821 commented Mar 15, 2019

I'd take this issue to get a bit familiar with the codebase (CM)

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 15, 2019

Thank you for taking this issue!

The relevant source is in src/tools/kdb/get.cpp method printTrace

e01306821 added a commit to e01306821/libelektra that referenced this issue Mar 15, 2019

e01306821 added a commit to e01306821/libelektra that referenced this issue Mar 15, 2019

e01306821 added a commit to e01306821/libelektra that referenced this issue Mar 15, 2019

Let kdb get -v display if value comes from default
Fixes ElektraInitiative#2474
Added release notes


Using char-array directly

@e01306821 e01306821 referenced a pull request that will close this issue Mar 15, 2019

Open

Let kdb get -v display if value comes from default #2499

1 of 5 tasks complete

e01306821 added a commit to e01306821/libelektra that referenced this issue Mar 18, 2019

Let kdb get -v display if value comes from default
Fixes ElektraInitiative#2474
Added release notes


Using char-array directly


Added markdown-tests and removed space in release-notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.