vals icon indicating copy to clipboard operation
vals copied to clipboard

nested multiline indenting is wrong

Open askripe opened this issue 2 years ago • 0 comments

versions:

% ~/bin/vals version
Version: dev
Git Commit:
% git log 
commit b752901de38611c9c292e9c626fb80f816f86e10 (HEAD -> main, tag: v0.33.0, origin/main, origin/HEAD)
Author: Antoine Miquel <[email protected]>
Date:   Sun Jan 21 03:02:01 2024 +0100

    Feat/conjur (#195)

    * feat: add conjur provider
...

problem: nested multilines are not parsed correctly, indenting is wrong (it is selected by first "|" symbol, not the nested one )

% cat 1.yaml
a: |
  v:
    a: |
      l: ue
      a: c
% cat 2.yaml
a: |
  v:
    a: |
      ref+vault://configs/tests.github#/-
% vault kv get --field='-' 'configs/tests.github'
l: ue
a: c

% cat 2.yaml|~/bin/vals eval -f -
a: |
  v:
    a: |
      l: ue
  a: c

real effort:

% cat 1.yaml |~/bin/vals eval -f - |yq -e ".a" |yq -e ".v.a"
l: ue
a: c
% cat 2.yaml |~/bin/vals eval -f - |yq -e ".a" |yq -e ".v.a"
l: ue

askripe avatar Jan 23 '24 21:01 askripe