-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why YAML? #8
Comments
Hi, actually you can write the spec in perl - it's just a hash of hashes and arrays. It would then be possible to dump it in any format. My goal was that I have a spec in a (programming) language independent format in the first place, so I just need to write the completion and doc generator once; only the app framework itself that runs it needs to be implemented in the language itself. So, it doesn't have to be YAML, but I think it should be a format which is easy to write and read. My use case was: I wanted to generate an app, and the subcommands and its parameters would be automatically generated by a specification from somewhere else. I started to autogenerate MooseX::App classes, but I actually didn't need an extra class for all of the subcommands, I just needed one. It was too much work and didn't feel like the right way, so I stopped that. I'm open for any suggestions! How would you want to write the spec? |
As someone currently working on implementing a web API and who started by writing a Swagger spec for it, I'm not in the position to tell you starting with a spec is a bad approach. :) But this is just that I find this a bit overkill for the command line interface of a program. |
Yeah, my work with Swagger is one of the reasons I started this =) I also thought about handling input and output. |
As an additional data-point on ways to use |
@dakkar funny, your definitions look just like mine (name, summary, aliases etc.). It also can do completion? |
@perlpunk they look like yours because I'm using |
@dakkar oh wow, appspec has its first user! \o/ |
I don't see the need for YAML.
It would be much simpler to write the spec in Perl.
If you had the need to parse the spec from outside the program itself (ex for documentation generators), you could just inject an
--export-getopt-spec
option that would dump the spec.The text was updated successfully, but these errors were encountered: