I am developing a custom completion command bashto capture job identifiers from a scheduling system (LSF, PBS, SLURM). I have basic functions, but I would like to expand it now with the help of "tips" that I saw at startup zsh.
For example, when I press TAB in the example grepbelow, I get:
grep -<TAB>
--after-context -A -- specify lines of trailing context
--basic-regexp -G -- use basic regular expression
--before-context -B -- specify lines of leading context
...
This third column after --is what I would like to add to my own completion bash. What is the correct technical term for this? Advice? Does the compgenfunctionality provide for this?
I am enclosing my current working example, which contains only identifiers. This example uses LSF.
function _mycurrentjobs()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(bjobs -noheader -u $USER -o JOBID)" -- $cur))
return 0
}
complete -F _mycurrentjobs bkill bjobs bstatus bpeek bstop bresume
, :
bjobs -noheader -u $USER -o "JOBID JOB_NAME"