clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
14.3k stars 1.04k forks source link

Consider supporting the CWL standard CommandLineTool for YAML specification of a CLI interface #1337

Closed mr-c closed 2 years ago

mr-c commented 6 years ago

Bug or Feature Request Summary

Specification: https://www.commonwl.org/v1.0/CommandLineTool.html User guide: https://www.commonwl.org/user_guide/

CWL project homepage: https://www.commonwl.org/

If some properties that you have aren't yet in CWL you can add them as "vendor extensions" and retain compatibility. We'd want to study your extensions for possible future inclusion.

CreepySkeleton commented 4 years ago

I haven't read the spec completely but looks pretty interesting. cc @clap-rs/admins What do you think?

pksunkara commented 4 years ago

So, I looked over the spec and I am really hesitant to support it. It will have too much noise compared to clap's yaml which will make it harder for users to use.

mr-c commented 4 years ago

@pksunkara What do you think about CWL export from clap-using apps?

pksunkara commented 4 years ago

I don't mind that, but it will have to go clap_generate crate and even then, I am not sure this is not niche.

CreepySkeleton commented 4 years ago

@mr-c The main goal of clap is to provide a flexible an feature-full parser for command line arguments, but the full scope of CWL is way beyond this goal. I don't think we'll ever consider supporting all of it.

About CLI part only - well, if it's all about building clap::App from corresponding cwl.yaml file it can be seen as "yet another format akin to YAML and TOML". We are considering to make use of serde (#1630). If/when we manage to implement it, you will be free to make your own implementation of it , like serde_json or serde_yaml.

Even if we decide not to support it, you are still free to make your own "converter" crate that reads cwl.yaml and builds the corresponding clap::App.

I'm closing this because I'm almost sure we don't want to maintain such an implementation in this repo.

Dylan-DPC-zz commented 4 years ago

I'd like to consider this in the future. Let's keep it open.

mr-c commented 4 years ago

@Dylan-DPC @CreepySkeleton I am happy to write a Google Summer of Code proposal and co-mentor alongside a rust person to work on CWL export from clap applications.

luizirber commented 4 years ago

This is pretty much exactly why I used the YAML feature to write my CLI. I had previously handwritten the equivalent command (compute) in CWL, and I think it would be extremely useful to have both more Rust CLIs in bioinformatics and larger adoption of CWL tool descriptions.

pksunkara commented 4 years ago

@codesections Could this come under documentation crate? Can one of the generators be CWL?

medcelerate commented 4 years ago

I would absolutely love this feature set, would make our biofx tools more powerful and easier to add to workflows.

Dylan-DPC-zz commented 4 years ago

Let's discuss this once we are done with the 3.0.0 release

epage commented 2 years ago

We have decided to deprecate the YAML API. For more details, see https://github.com/clap-rs/clap/issues/3087. I am assuming this would fall in the same category. If there is interest in a data-driven API, it will likely be broken out into a clap_yaml and developed independent from the core of clap.