kloetzl / biozsh

the z in bioinformatics
MIT License
33 stars 5 forks source link

update _samtools and fix a bug #12

Closed cgjosephlee closed 5 years ago

cgjosephlee commented 5 years ago

Update to samtools v1.8, but not all subcommands are implemented.

And v1.9 removes some options in mpileup, I haven't updated to this version yet.

cgjosephlee commented 5 years ago

Just curious, how does this if clause work? https://github.com/kloetzl/biozsh/blob/c163056182bd1fcceefae3516695abdaba37eac4/completions/_samtools#L271

I guess if the subcommand is not defined, it will show a warning message. I have tried a few circumstances and did not see the message popup. Would you please give a brief explanation?

kloetzl commented 5 years ago

Thanks for your work!

Would you please give a brief explanation?

Quoting from the docs:

If a function name exists, it is called with the arguments args. The return argument gives the name of a parameter in which the return status from the function name should be stored; if return is empty or a single hyphen it is ignored.

The return status of _call_function itself is zero if the function name exists and was called and non-zero otherwise.

If you do not see the message, maybe your zsh theme simply just doesn't show them? I had to add the following lines to my dotfiles to see them. source.

# Display message when no matches are found
# formatting and messages
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %B%d%b'
cgjosephlee commented 5 years ago

update samtools view options.

cgjosephlee commented 5 years ago

Commits rebased!

kloetzl commented 5 years ago

Merged, thanks!