hexylena / argparse2tool

transparently build CWL and Galaxy XML tool definitions for any script that uses argparse
Apache License 2.0
26 stars 10 forks source link

galaxy subparser parity with cwl #61

Closed hexylena closed 4 years ago

hexylena commented 6 years ago

they support foo.py --generate and foo.py foo --generate which does just a single subparser named foo rather than all. Need to figure out what they're doing differently and perhaps unify the code.

mr-c commented 6 years ago

Ah, perhaps a stylistic choice on our part? In CWL we try to do one-function per description; so that probably got mapped as one CWL description per subparser by @anton-khodak .

hexylena commented 6 years ago

Very well could be. I'll probably refactor my half to match y'all's whenever I find time for it.

hexylena commented 6 years ago

E.g. there's some significant overlap that could probably be refactored into something cleaner. https://github.com/erasche/argparse2tool/blob/master/argparse/__init__.py#L133 which I borrowed from https://github.com/erasche/argparse2tool/blob/master/argparse/__init__.py#L84

bernt-matthias commented 4 years ago

https://github.com/hexylena/argparse2tool/pull/65 writes subparsers to separate xml files if --directory parameter is given.

foo.py foo --generate still does not work .. but I would find it not very handy to generate xml this way from the command line since one does not know the names of the subparsers.

hexylena commented 4 years ago

@bernt-matthias agreed, with --directory is good enough. I didn't consider the "have to enumerate submodules" case.