aCLImatise / CliHelpParser

Reads the output from CLI help commands, and generates machine readable schemas (CWL etc)
https://aclimatise.github.io/CliHelpParser/
GNU General Public License v3.0
14 stars 5 forks source link

Better logic for combining types from description, argument and names #37

Open bernt-matthias opened 4 years ago

bernt-matthias commented 4 years ago

For instance, for the following parameter from samtools sort:

-o FILE    Write final output to FILE rather than standard output

only "FILE" is sent to the regular expressions. But in order to make https://github.com/aCLImatise/CliHelpParser/pull/15 work also the description would be needed.

multimeric commented 4 years ago

Hmm, both strings should be separately passed to infer_type. Are you sure this isn't happening?

multimeric commented 4 years ago

Yes, so currently we call it 3 times for a flag like this. Once on the flag name (a in this case), once on the argument (FILE in this case), and finally once on the full description string: https://github.com/aCLImatise/CliHelpParser/blob/017bfe01dab6eb133deaf6f64060277233dfa200/acclimatise/model.py#L294-L304.

If you think you have found a smarter way to combine this information, feel free to edit the Flag.get_type() method, add a test case, and submit it as a PR.

bernt-matthias commented 4 years ago

Maybe something like this: https://github.com/aCLImatise/CliHelpParser/pull/38