ngless-toolkit / ngless

NGLess: NGS with less work
https://ngless.embl.de
Other
142 stars 24 forks source link

'when-true' unused in flags in external modules #58

Closed unode closed 6 years ago

unode commented 6 years ago

One argument in an external module:

 -    
                name: relative_abundance
                atype: flag
                when-true: '--make_relative_abundance'

which I then use with func(relative_abundance=true).

This however causes:

Exiting after fatal error while loading and running script
System Error
Error running command for function "func"
        exit code = 1
        stdout=''
        stderr=' /path/to/Modules/example.ngm/1.0/./run.sh: unrecognized option '--relative_abundance'

'

It seems the name is passed as-is. The workaround is to give the same name as the argument but this causes problems with some options containing dashes: --max-values -> func(max-values=true).

luispedro commented 6 years ago

Do you have a quick way to test this? If so, can you try the linked patch (on a separate branch).

unode commented 6 years ago

Pushed a test to the same branch. It passed when I tested locally and failed before the fix. Thanks for the quick fix