mkideal / cli

CLI - A package for building command line app with go
MIT License
730 stars 43 forks source link

Wish: YAML support #17

Closed suntong closed 8 years ago

suntong commented 8 years ago

Hi 仕晋,

Hope you will consider adding YAML support as the config file format. I know it is almost 98% like json, however the difference is significant in expressiveness to me. E.g., please take a look at the following same info represented in YAML and json:

foo: "bar"
baz: 
  - "qux"
  - "quxx"
corge: null
grault: 1
garply: true
waldo: "false"
fred: "undefined"
emptyArray: []
emptyObject: {}
emptyString: ""
{
  "foo": "bar",
  "baz": [
    "qux",
    "quxx"
  ],
  "corge": null,
  "grault": 1,
  "garply": true,
  "waldo": "false",
  "fred": "undefined",
  "emptyArray": [],
  "emptyObject": {},
  "emptyString": ""
}

I had almost wanted to give up YAML and use json as the config file format, but once I started doing it, I realize it is going backward in expressiveness.

Please consider.

Thanks

suntong commented 8 years ago

Hmm..., never mind. I decided to split my configuration into two, for running the program itself (using json), and anything else (use YAML).

So you can put it in very very low priority. :-)

mkideal commented 8 years ago

So seay to add YAML support, but external package needed.

suntong commented 8 years ago

Yeah, indeed, somebody may not like the idea of extra external package.

So, again, you can put it in very very low priority.

suntong commented 8 years ago

closing it as I don't think it is necessary now -- CLI now is perfect already.