epage / clapng

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

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

Open epage opened 2 years ago

epage commented 2 years ago

Issue by mr-c Wednesday Sep 05, 2018 at 11:19 GMT Originally opened as https://github.com/clap-rs/clap/issues/1337


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.

epage commented 2 years ago

Comment by CreepySkeleton Sunday Feb 02, 2020 at 05:54 GMT


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

epage commented 2 years ago

Comment by pksunkara Sunday Feb 02, 2020 at 13:56 GMT


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.

epage commented 2 years ago

Comment by mr-c Monday Feb 03, 2020 at 10:03 GMT


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

epage commented 2 years ago

Comment by pksunkara Monday Feb 03, 2020 at 10:04 GMT


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.

epage commented 2 years ago

Comment by CreepySkeleton Monday Feb 03, 2020 at 11:15 GMT


@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.

epage commented 2 years ago

Comment by Dylan-DPC Monday Feb 03, 2020 at 12:18 GMT


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

epage commented 2 years ago

Comment by mr-c Monday Feb 03, 2020 at 12:43 GMT


@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.

epage commented 2 years ago

Comment by luizirber Monday Feb 03, 2020 at 23:27 GMT


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.

epage commented 2 years ago

Comment by pksunkara Tuesday Feb 04, 2020 at 07:51 GMT


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

epage commented 2 years ago

Comment by medcelerate Tuesday Feb 04, 2020 at 19:15 GMT


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

epage commented 2 years ago

Comment by Dylan-DPC Tuesday Feb 04, 2020 at 19:33 GMT


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