return an empty value without an error #328
Answered
by
TomWright
electriquo
asked this question in
Q&A
-
if i am not mistaken, in the past dasel did not fail when accessing properties that do not exist and was returning an empty value, which is not the case for dasel version $ echo '
foo:
bar: baz
' | dasel -r yaml "foo.prop"
Error: could not access map index: property not found: prop how can i make dasel return an empty value and not to fail when accessing non existing property? |
Beta Was this translation helpful? Give feedback.
Answered by
TomWright
Jun 5, 2023
Replies: 1 comment 3 replies
-
That was actually a bug stopping errors being displayed for select commands, although errors should we written to stderr with stdout being blank. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can follow the property name with a
?
to allow dasel to continue without error: https://daseldocs.tomwright.me/functions/property#property-with-optional-field