Juniper / libxo

The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced.
http://juniper.github.io/libxo/libxo-manual.html
BSD 2-Clause "Simplified" License
321 stars 48 forks source link

"xo" need option to make JSON object wrapper #60

Closed philshafer closed 5 years ago

philshafer commented 6 years ago
$ xo --wrap "a/b/c" --json --pretty "{:name}{:value}\n" one a
"a": {
  "b": {
    "c": {
      "name": "one",
      "value": "a"
    }
  }
}

which isn't a complete json object. A "--object-wrapper" option should put the entire output inside a "{}" wrapper. This should be true for "--open" and "--close" as well.

philshafer commented 5 years ago

This is in the "develop" branch as "--top-wrap".

Thanks, Phil