Libelektra: kdb export with `yaml` plugin does not add newline

Created on 2 Dec 2019  ·  6Comments  ·  Source: ElektraInitiative/libelektra

Steps to Reproduce the Problem

I tried to do the asciinema recording with yaml but the missing newline makes it weird

kdb set user/hello/hello/world "Hello World"
kdb export user/hello yaml

Expected Result

Note that elektra $ is the user and $ the delimiter (shell configured that way in docker image)

elektra $ kdb export user/hello yaml
hello:
  world: Hello World!
elektra $ 

Actual Result

elektra $ kdb export user/hello yaml
hello:
  world: Hello Worldelektra $ 

System Information

docker run -it elektra/elektra

Further Log Files and Output

bug

Most helpful comment

@sanssecours can you take a look please?

Sorry, I do not think I have time for that at the moment.

All 6 comments

Thank you for reporting! I can reproduce it also without the docker image.

@sanssecours can you take a look please?

@sanssecours can you take a look please?

Sorry, I do not think I have time for that at the moment.

workaround is something like:

echo `kdb export user/hello yaml`

Doing this in the asciinema recording would be really weird...

If you want a quick “workaround”, then just replace the line:

https://github.com/ElektraInitiative/libelektra/blob/3c53b19a51b41e9588284a1943d8c25211748a42/src/plugins/yamlcpp/write.cpp#L536

with the code

output << data << endl;

.

@sanssecours thank you!

I applied this patch only to the docker image. It's basically only a playground anyway.

Maybe we can fix this properly before the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus2330 picture markus2330  ·  28Comments

ingwinlu picture ingwinlu  ·  36Comments

markus2330 picture markus2330  ·  49Comments

haraldg picture haraldg  ·  65Comments

kodebach picture kodebach  ·  29Comments