by tmpfs · 9y ago · 0 comments
Effectively you end up with two objects, one describing the program and another describing the parsed arguments which should then be passed through a plugin pipeline. The existing runtime plugins[3] illustrate this.
> if there is an automated way to make use of these.
There is using the nodejs runtime, take a look at the source for the mkcli program[4] to get a feel for how it works.
> stepping stone towards a more language agnostic way of defining command-line interfaces
I couldn't agree more, ideally we would implement runtimes in most of the mainstream languages using the pattern described above :)
Hope that helps & thanks for the feedback!
[1]: https://github.com/mkdoc/mkcli-runtime [2]: https://github.com/cli-kit/cli-argparse [3]: https://github.com/mkdoc/mkcli-runtime/tree/master/plugin [4]: https://github.com/mkdoc/mkdoc/blob/master/cli/cli.js
No comments yet.