[ffx][config] Separate nested ops from value maps

This breaks up the logic around doing nested gets/sets/removes
from the logic that does mapping and string interpolation on
leaf Value files.

In the process, it removes the currying and cons-ish recursion
of the mapping functions, in favour of a more rust-y helper
trait nested_map that you can call on either an Option<Value>
or a ConfigValue, and then call with another mapping function.

I think it's really nice that this puts the order of the value
mapping operations in linear instead of reverse order to how
they actually run. I think it makes the code much less confusing.

The various nested_* things get moved again, this time to their
own module, as they no longer perform mapping operations
(other than NestedMap::nested_map, but I think it belongs with
the other nested functions).

Some of this restructuring may be useful to create a better
starting point for resolving fxb/101249, but this CL is not
intended to fix that on its own.

Another minor inclusion is adding a file processing argument
to the ffx-config-get arguments, which proved useful in finding
the last problems with this CL.

Bug: 101249

Change-Id: Ica85b352f3e7bb1add30d9ffbec12d88a00ee77f
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/690544
Reviewed-by: Andy Weiss <dragonbear@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Reviewed-by: Steven Grady <slgrady@google.com>
Fuchsia-Auto-Submit: Megan Batty <mgnb@google.com>
21 files changed
tree: 5cff73ee91ba075f677dd11b5e17ddc8be4a6a8d
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. products/
  7. scripts/
  8. sdk/
  9. src/
  10. third_party/
  11. tools/
  12. zircon/
  13. .clang-format
  14. .clang-tidy
  15. .editorconfig
  16. .git-blame-ignore-revs
  17. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. analysis_options.yaml
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. pyrightconfig.json
  30. README.md
  31. rustfmt.toml
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.