scream icon indicating copy to clipboard operation
scream copied to clipboard

Make atmquery print all XML children if node name is not a leaf

Open bartgol opened this issue 2 years ago • 1 comments

Given a node like

shoc
  enable_column_conservation_checks: false
  number_of_subcycles: 1
  enable_precondition_checks: true
  enable_postcondition_checks: true
  repair_log_level: trace
  internal_diagnostics_level: 0
  compute_tendencies: NONE

we currently get

$ ./atmquery p3
    namelist_defaults::atmosphere_processes::physics::mac_aero_mic::p3: 
$

while it would be nice to get the whole tree.

Bonus points: we should prob only print the namespaces needed to uniquely identify the node. For uses without --grep, the user-provided string should already be enough for this, since in case of ambiguity we error out anyways. If --grep is passed, we can print all namespaces.

bartgol avatar Jun 29 '23 17:06 bartgol

Actually, I just ran ./atmquery --grep shoc, and it did print exactly what I wanted (the node, along with its children), so maybe this is just a matter of replicating the logic for --grep in the non-grep case...

bartgol avatar Jun 29 '23 17:06 bartgol