title: Parse yaml file with varying number of key:values
body: <p>Long story short, I will be parsing yaml files in a directory with bash using yq. My yaml files could look like this:</p>
  
  <pre><code>CLIENT_FIRST_NAME: bob
  CLIENT_LAST_NAME: smith
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>CLIENT_FIRST_NAME: bob
  CLIENT_LAST_NAME: smith
  CLIENT_MIDDLE_NAME: michael
  </code></pre>
  
  <p>So I am looping through each file with a do loop and setting the variables to values
  For example:</p>
  
  <pre><code>for f in $FILES
  do
    FIRSTNAME=$(yq r $f CLIENT_FIRST_NAME)
    LASTNAME=$(yq r $f CLIENT_LAST_NAME)
  add client --firstname=${FIRSTNAME} --lastname=${LASTNAME}
  done
  </code></pre>
  
  <p>But sometimes I will have that middle name and I would need to include that:</p>
  
  <pre><code>add client --firstname=${FIRSTNAME} --lastname=${LASTNAME} --middlename=${MIDDLENAME}
  </code></pre>
  
  <p>The order doesn't matter, I just need to be able to account for additional fields that may show up in the yaml that need to be added to the 'add client' command. EVERY line in the yaml will be added to the command.  Every key added will be a viable parameter for the 'add client' command. I don't have to worry about whether or not a key in the yaml is a valid parameter. They WILL be.</p>
  
  <p>Curious on the best approach to the unknown here. Thanks!  </p>