We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63c9e6c commit 0528383Copy full SHA for 0528383
etc/bash_completion.d/sambamba
@@ -51,9 +51,21 @@ _sambamba()
51
elif [[ ${COMP_WORDS[COMP_CWORD - 2]} == "--format" || ${COMP_WORDS[COMP_CWORD - 1]} == "-f" ]]; then
52
COMPREPLY=( $(compgen -W "sam bam json msgpack" -- $cur) )
53
compopt +o nospace
54
+ elif [[ $subcommand == "view" || $subcommand == "slice" ]]; then
55
+ for word in ${COMP_WORDS[@]}; do
56
+ if [[ $word == *.bam && $word != "" ]]; then
57
+ eval abspath=$word
58
+ COMPREPLY=( $(sambamba view -H $abspath | grep @SQ | \
59
+ cut -f 2 | cut -f2 -d: 2>/dev/null | grep "^$cur") )
60
+ break
61
+ fi
62
+ done
63
+ compopt -o default
64
+ compopt -o filenames
65
else
66
compopt -o default
67
fi
68
}
69
70
complete -o nospace -F _sambamba sambamba
71
+# vim: set syntax=sh :
0 commit comments